@@ -28,7 +28,7 @@ pub enum UnsafetyViolationKind {
28
28
29
29
#[ derive( Copy , Clone , PartialEq , TyEncodable , TyDecodable , HashStable , Debug ) ]
30
30
pub enum UnsafetyViolationDetails {
31
- CallToUnsafeFunction ,
31
+ CallToUnsafeFunction ( Option < DefId > ) ,
32
32
UseOfInlineAssembly ,
33
33
InitializingTypeWith ,
34
34
CastOfPointerToInt ,
@@ -39,14 +39,14 @@ pub enum UnsafetyViolationDetails {
39
39
AccessToUnionField ,
40
40
MutationOfLayoutConstrainedField ,
41
41
BorrowOfLayoutConstrainedField ,
42
- CallToFunctionWith ,
42
+ CallToFunctionWith ( DefId ) ,
43
43
}
44
44
45
45
impl UnsafetyViolationDetails {
46
46
pub fn description_and_note ( & self ) -> ( & ' static str , & ' static str ) {
47
47
use UnsafetyViolationDetails :: * ;
48
48
match self {
49
- CallToUnsafeFunction => (
49
+ CallToUnsafeFunction ( .. ) => (
50
50
"call to unsafe function" ,
51
51
"consult the function's documentation for information on how to avoid undefined \
52
52
behavior",
@@ -97,7 +97,7 @@ impl UnsafetyViolationDetails {
97
97
"references to fields of layout constrained fields lose the constraints. Coupled \
98
98
with interior mutability, the field can be changed to invalid values",
99
99
) ,
100
- CallToFunctionWith => (
100
+ CallToFunctionWith ( .. ) => (
101
101
"call to function with `#[target_feature]`" ,
102
102
"can only be called if the required target features are available" ,
103
103
) ,
0 commit comments