1
1
error: a dangling pointer will be produced because the temporary `CString` will be dropped
2
- --> $DIR/types.rs:20 :26
2
+ --> $DIR/types.rs:21 :26
3
3
|
4
4
LL | declval::<CString>().as_ptr();
5
5
| -------------------- ^^^^^^ this pointer will immediately be invalid
@@ -15,7 +15,7 @@ LL | #![deny(dangling_pointers_from_temporaries)]
15
15
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
16
17
17
error: a dangling pointer will be produced because the temporary `String` will be dropped
18
- --> $DIR/types.rs:22 :25
18
+ --> $DIR/types.rs:23 :25
19
19
|
20
20
LL | declval::<String>().as_ptr();
21
21
| ------------------- ^^^^^^ this pointer will immediately be invalid
@@ -26,7 +26,7 @@ LL | declval::<String>().as_ptr();
26
26
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
27
27
28
28
error: a dangling pointer will be produced because the temporary `Vec<u8>` will be dropped
29
- --> $DIR/types.rs:24 :26
29
+ --> $DIR/types.rs:25 :26
30
30
|
31
31
LL | declval::<Vec<u8>>().as_ptr();
32
32
| -------------------- ^^^^^^ this pointer will immediately be invalid
@@ -37,7 +37,7 @@ LL | declval::<Vec<u8>>().as_ptr();
37
37
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
38
38
39
39
error: a dangling pointer will be produced because the temporary `Box<CString>` will be dropped
40
- --> $DIR/types.rs:26 :31
40
+ --> $DIR/types.rs:27 :31
41
41
|
42
42
LL | declval::<Box<CString>>().as_ptr();
43
43
| ------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -48,7 +48,7 @@ LL | declval::<Box<CString>>().as_ptr();
48
48
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
49
49
50
50
error: a dangling pointer will be produced because the temporary `Box<[u8]>` will be dropped
51
- --> $DIR/types.rs:28 :28
51
+ --> $DIR/types.rs:29 :28
52
52
|
53
53
LL | declval::<Box<[u8]>>().as_ptr();
54
54
| ---------------------- ^^^^^^ this pointer will immediately be invalid
@@ -59,7 +59,7 @@ LL | declval::<Box<[u8]>>().as_ptr();
59
59
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
60
60
61
61
error: a dangling pointer will be produced because the temporary `Box<str>` will be dropped
62
- --> $DIR/types.rs:30 :27
62
+ --> $DIR/types.rs:31 :27
63
63
|
64
64
LL | declval::<Box<str>>().as_ptr();
65
65
| --------------------- ^^^^^^ this pointer will immediately be invalid
@@ -70,7 +70,7 @@ LL | declval::<Box<str>>().as_ptr();
70
70
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
71
71
72
72
error: a dangling pointer will be produced because the temporary `Box<CStr>` will be dropped
73
- --> $DIR/types.rs:32 :28
73
+ --> $DIR/types.rs:33 :28
74
74
|
75
75
LL | declval::<Box<CStr>>().as_ptr();
76
76
| ---------------------- ^^^^^^ this pointer will immediately be invalid
@@ -81,7 +81,7 @@ LL | declval::<Box<CStr>>().as_ptr();
81
81
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
82
82
83
83
error: a dangling pointer will be produced because the temporary `[u8; 10]` will be dropped
84
- --> $DIR/types.rs:34 :27
84
+ --> $DIR/types.rs:35 :27
85
85
|
86
86
LL | declval::<[u8; 10]>().as_ptr();
87
87
| --------------------- ^^^^^^ this pointer will immediately be invalid
@@ -92,7 +92,7 @@ LL | declval::<[u8; 10]>().as_ptr();
92
92
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
93
93
94
94
error: a dangling pointer will be produced because the temporary `Box<[u8; 10]>` will be dropped
95
- --> $DIR/types.rs:36 :32
95
+ --> $DIR/types.rs:37 :32
96
96
|
97
97
LL | declval::<Box<[u8; 10]>>().as_ptr();
98
98
| -------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -103,7 +103,7 @@ LL | declval::<Box<[u8; 10]>>().as_ptr();
103
103
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
104
104
105
105
error: a dangling pointer will be produced because the temporary `Box<Vec<u8>>` will be dropped
106
- --> $DIR/types.rs:38 :31
106
+ --> $DIR/types.rs:39 :31
107
107
|
108
108
LL | declval::<Box<Vec<u8>>>().as_ptr();
109
109
| ------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -114,7 +114,7 @@ LL | declval::<Box<Vec<u8>>>().as_ptr();
114
114
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
115
115
116
116
error: a dangling pointer will be produced because the temporary `Box<String>` will be dropped
117
- --> $DIR/types.rs:40 :30
117
+ --> $DIR/types.rs:41 :30
118
118
|
119
119
LL | declval::<Box<String>>().as_ptr();
120
120
| ------------------------ ^^^^^^ this pointer will immediately be invalid
@@ -125,7 +125,7 @@ LL | declval::<Box<String>>().as_ptr();
125
125
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
126
126
127
127
error: a dangling pointer will be produced because the temporary `Box<Box<Box<Box<[u8]>>>>` will be dropped
128
- --> $DIR/types.rs:42 :43
128
+ --> $DIR/types.rs:43 :43
129
129
|
130
130
LL | declval::<Box<Box<Box<Box<[u8]>>>>>().as_ptr();
131
131
| ------------------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -136,7 +136,7 @@ LL | declval::<Box<Box<Box<Box<[u8]>>>>>().as_ptr();
136
136
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
137
137
138
138
error: a dangling pointer will be produced because the temporary `Cell<u8>` will be dropped
139
- --> $DIR/types.rs:44 :27
139
+ --> $DIR/types.rs:45 :27
140
140
|
141
141
LL | declval::<Cell<u8>>().as_ptr();
142
142
| --------------------- ^^^^^^ this pointer will immediately be invalid
@@ -147,7 +147,7 @@ LL | declval::<Cell<u8>>().as_ptr();
147
147
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
148
148
149
149
error: a dangling pointer will be produced because the temporary `MaybeUninit<u8>` will be dropped
150
- --> $DIR/types.rs:46 :34
150
+ --> $DIR/types.rs:47 :34
151
151
|
152
152
LL | declval::<MaybeUninit<u8>>().as_ptr();
153
153
| ---------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -158,7 +158,7 @@ LL | declval::<MaybeUninit<u8>>().as_ptr();
158
158
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
159
159
160
160
error: a dangling pointer will be produced because the temporary `Vec<AsPtrFake>` will be dropped
161
- --> $DIR/types.rs:48 :33
161
+ --> $DIR/types.rs:49 :33
162
162
|
163
163
LL | declval::<Vec<AsPtrFake>>().as_ptr();
164
164
| --------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -168,5 +168,27 @@ LL | declval::<Vec<AsPtrFake>>().as_ptr();
168
168
= note: pointers do not have a lifetime; when calling `as_ptr` the `Vec<AsPtrFake>` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
169
169
= help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
170
170
171
- error: aborting due to 15 previous errors
171
+ error: a dangling pointer will be produced because the temporary `UnsafeCell<u8>` will be dropped
172
+ --> $DIR/types.rs:51:33
173
+ |
174
+ LL | declval::<UnsafeCell<u8>>().get();
175
+ | --------------------------- ^^^ this pointer will immediately be invalid
176
+ | |
177
+ | this `UnsafeCell<u8>` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
178
+ |
179
+ = note: pointers do not have a lifetime; when calling `get` the `UnsafeCell<u8>` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
180
+ = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
181
+
182
+ error: a dangling pointer will be produced because the temporary `SyncUnsafeCell<u8>` will be dropped
183
+ --> $DIR/types.rs:53:37
184
+ |
185
+ LL | declval::<SyncUnsafeCell<u8>>().get();
186
+ | ------------------------------- ^^^ this pointer will immediately be invalid
187
+ | |
188
+ | this `SyncUnsafeCell<u8>` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
189
+ |
190
+ = note: pointers do not have a lifetime; when calling `get` the `SyncUnsafeCell<u8>` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
191
+ = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
192
+
193
+ error: aborting due to 17 previous errors
172
194
0 commit comments