1
1
warning: implicit auto-ref creates a reference to a dereference of a raw pointer
2
- --> $DIR/implicit_unsafe_autorefs.rs:7 :18
2
+ --> $DIR/implicit_unsafe_autorefs.rs:8 :18
3
3
|
4
4
LL | addr_of_mut!((*ptr)[..16])
5
5
| ^^^^^^
@@ -12,7 +12,7 @@ LL | addr_of_mut!((&mut (*ptr))[..16])
12
12
| +++++ +
13
13
14
14
warning: implicit auto-ref creates a reference to a dereference of a raw pointer
15
- --> $DIR/implicit_unsafe_autorefs.rs:12 :14
15
+ --> $DIR/implicit_unsafe_autorefs.rs:13 :14
16
16
|
17
17
LL | addr_of!((*ptr)[..16])
18
18
| ^^^^^^
@@ -24,7 +24,7 @@ LL | addr_of!((&(*ptr))[..16])
24
24
| ++ +
25
25
26
26
warning: implicit auto-ref creates a reference to a dereference of a raw pointer
27
- --> $DIR/implicit_unsafe_autorefs.rs:21 :13
27
+ --> $DIR/implicit_unsafe_autorefs.rs:22 :13
28
28
|
29
29
LL | let l = (*ptr).field.len();
30
30
| ^^^^^^^^^^^^
@@ -36,7 +36,7 @@ LL | let l = (&(*ptr).field).len();
36
36
| ++ +
37
37
38
38
warning: implicit auto-ref creates a reference to a dereference of a raw pointer
39
- --> $DIR/implicit_unsafe_autorefs.rs:24 :14
39
+ --> $DIR/implicit_unsafe_autorefs.rs:25 :14
40
40
|
41
41
LL | addr_of!((*ptr).field[..l - 1])
42
42
| ^^^^^^^^^^^^
@@ -48,7 +48,7 @@ LL | addr_of!((&(*ptr).field)[..l - 1])
48
48
| ++ +
49
49
50
50
warning: implicit auto-ref creates a reference to a dereference of a raw pointer
51
- --> $DIR/implicit_unsafe_autorefs.rs:30 :9
51
+ --> $DIR/implicit_unsafe_autorefs.rs:31 :9
52
52
|
53
53
LL | _ = (*a)[0].len();
54
54
| ^^^^^^^
@@ -60,7 +60,7 @@ LL | _ = (&(*a)[0]).len();
60
60
| ++ +
61
61
62
62
warning: implicit auto-ref creates a reference to a dereference of a raw pointer
63
- --> $DIR/implicit_unsafe_autorefs.rs:34 :9
63
+ --> $DIR/implicit_unsafe_autorefs.rs:35 :9
64
64
|
65
65
LL | _ = (*a)[..1][0].len();
66
66
| ^^^^
@@ -71,5 +71,29 @@ help: try using a raw pointer method instead; or if this reference is intentiona
71
71
LL | _ = (&(*a))[..1][0].len();
72
72
| ++ +
73
73
74
- warning: 6 warnings emitted
74
+ warning: implicit auto-ref creates a reference to a dereference of a raw pointer
75
+ --> $DIR/implicit_unsafe_autorefs.rs:40:18
76
+ |
77
+ LL | _ = addr_of!((*ptr).field);
78
+ | ^^^^^^
79
+ |
80
+ = note: creating a reference requires the pointer to be valid and imposes aliasing requirements
81
+ help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
82
+ |
83
+ LL | _ = addr_of!((&(*ptr)).field);
84
+ | ++ +
85
+
86
+ warning: implicit auto-ref creates a reference to a dereference of a raw pointer
87
+ --> $DIR/implicit_unsafe_autorefs.rs:45:22
88
+ |
89
+ LL | _ = addr_of_mut!((*ptr).field);
90
+ | ^^^^^^
91
+ |
92
+ = note: creating a reference requires the pointer to be valid and imposes aliasing requirements
93
+ help: try using a raw pointer method instead; or if this reference is intentional, make it explicit
94
+ |
95
+ LL | _ = addr_of_mut!((&mut (*ptr)).field);
96
+ | +++++ +
97
+
98
+ warning: 8 warnings emitted
75
99
0 commit comments