@@ -11,50 +11,60 @@ unsafe fn unsf() {}
11
11
pub unsafe fn foo() { unsafe {
12
12
//~^ NOTE an unsafe function restricts its caller, but its body is safe by default
13
13
unsf(); //~ ERROR call to unsafe function `unsf` is unsafe
14
- //~^ NOTE
15
- //~| NOTE
14
+ //~^ NOTE call to unsafe function
15
+ //~| NOTE for more information, see issue #71668
16
+ //~| NOTE consult the function's documentation
16
17
unsf(); //~ ERROR call to unsafe function `unsf` is unsafe
17
- //~^ NOTE
18
- //~| NOTE
18
+ //~^ NOTE call to unsafe function
19
+ //~| NOTE for more information, see issue #71668
20
+ //~| NOTE consult the function's documentation
19
21
}}
20
22
21
23
pub unsafe fn bar(x: *const i32) -> i32 { unsafe {
22
24
//~^ NOTE an unsafe function restricts its caller, but its body is safe by default
23
25
let y = *x; //~ ERROR dereference of raw pointer is unsafe and requires unsafe block
24
- //~^ NOTE
25
- //~| NOTE
26
+ //~^ NOTE dereference of raw pointer
27
+ //~| NOTE for more information, see issue #71668
28
+ //~| NOTE raw pointers may be null
26
29
y + *x //~ ERROR dereference of raw pointer is unsafe and requires unsafe block
27
- //~^ NOTE
28
- //~| NOTE
30
+ //~^ NOTE dereference of raw pointer
31
+ //~| NOTE for more information, see issue #71668
32
+ //~| NOTE raw pointers may be null
29
33
}}
30
34
31
35
static mut BAZ: i32 = 0;
32
36
pub unsafe fn baz() -> i32 { unsafe {
33
37
//~^ NOTE an unsafe function restricts its caller, but its body is safe by default
34
38
let y = BAZ; //~ ERROR use of mutable static is unsafe and requires unsafe block
35
- //~^ NOTE
36
- //~| NOTE
39
+ //~^ NOTE use of mutable static
40
+ //~| NOTE for more information, see issue #71668
41
+ //~| NOTE mutable statics can be mutated by multiple threads
37
42
y + BAZ //~ ERROR use of mutable static is unsafe and requires unsafe block
38
- //~^ NOTE
39
- //~| NOTE
43
+ //~^ NOTE use of mutable static
44
+ //~| NOTE for more information, see issue #71668
45
+ //~| NOTE mutable statics can be mutated by multiple threads
40
46
}}
41
47
42
48
macro_rules! unsafe_macro { () => (unsf()) }
43
49
//~^ ERROR call to unsafe function `unsf` is unsafe
44
- //~| NOTE
45
- //~| NOTE
50
+ //~| NOTE call to unsafe function
51
+ //~| NOTE for more information, see issue #71668
52
+ //~| NOTE consult the function's documentation
46
53
//~| ERROR call to unsafe function `unsf` is unsafe
47
- //~| NOTE
48
- //~| NOTE
54
+ //~| NOTE call to unsafe function
55
+ //~| NOTE for more information, see issue #71668
56
+ //~| NOTE consult the function's documentation
49
57
50
58
pub unsafe fn unsafe_in_macro() { unsafe {
51
59
//~^ NOTE an unsafe function restricts its caller, but its body is safe by default
52
60
unsafe_macro!();
53
- //~^ NOTE
54
- //~| NOTE
61
+ //~^ NOTE in this expansion
62
+ //~| NOTE in this expansion
63
+ //~| NOTE in this expansion
55
64
unsafe_macro!();
56
- //~^ NOTE
57
- //~| NOTE
65
+ //~^ NOTE in this expansion
66
+ //~| NOTE in this expansion
67
+ //~| NOTE in this expansion
58
68
}}
59
69
60
70
pub unsafe fn unsafe_in_external_macro() {
0 commit comments