11error: 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
33 |
44LL | declval::<CString>().as_ptr();
55 | -------------------- ^^^^^^ this pointer will immediately be invalid
@@ -15,7 +15,7 @@ LL | #![deny(dangling_pointers_from_temporaries)]
1515 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616
1717error: 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
1919 |
2020LL | declval::<String>().as_ptr();
2121 | ------------------- ^^^^^^ this pointer will immediately be invalid
@@ -26,7 +26,7 @@ LL | declval::<String>().as_ptr();
2626 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
2727
2828error: 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
3030 |
3131LL | declval::<Vec<u8>>().as_ptr();
3232 | -------------------- ^^^^^^ this pointer will immediately be invalid
@@ -37,7 +37,7 @@ LL | declval::<Vec<u8>>().as_ptr();
3737 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
3838
3939error: 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
4141 |
4242LL | declval::<Box<CString>>().as_ptr();
4343 | ------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -48,7 +48,7 @@ LL | declval::<Box<CString>>().as_ptr();
4848 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
4949
5050error: 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
5252 |
5353LL | declval::<Box<[u8]>>().as_ptr();
5454 | ---------------------- ^^^^^^ this pointer will immediately be invalid
@@ -59,7 +59,7 @@ LL | declval::<Box<[u8]>>().as_ptr();
5959 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
6060
6161error: 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
6363 |
6464LL | declval::<Box<str>>().as_ptr();
6565 | --------------------- ^^^^^^ this pointer will immediately be invalid
@@ -70,7 +70,7 @@ LL | declval::<Box<str>>().as_ptr();
7070 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
7171
7272error: 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
7474 |
7575LL | declval::<Box<CStr>>().as_ptr();
7676 | ---------------------- ^^^^^^ this pointer will immediately be invalid
@@ -81,7 +81,7 @@ LL | declval::<Box<CStr>>().as_ptr();
8181 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
8282
8383error: 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
8585 |
8686LL | declval::<[u8; 10]>().as_ptr();
8787 | --------------------- ^^^^^^ this pointer will immediately be invalid
@@ -92,7 +92,7 @@ LL | declval::<[u8; 10]>().as_ptr();
9292 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
9393
9494error: 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
9696 |
9797LL | declval::<Box<[u8; 10]>>().as_ptr();
9898 | -------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -103,7 +103,7 @@ LL | declval::<Box<[u8; 10]>>().as_ptr();
103103 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
104104
105105error: 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
107107 |
108108LL | declval::<Box<Vec<u8>>>().as_ptr();
109109 | ------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -114,7 +114,7 @@ LL | declval::<Box<Vec<u8>>>().as_ptr();
114114 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
115115
116116error: 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
118118 |
119119LL | declval::<Box<String>>().as_ptr();
120120 | ------------------------ ^^^^^^ this pointer will immediately be invalid
@@ -125,7 +125,7 @@ LL | declval::<Box<String>>().as_ptr();
125125 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
126126
127127error: 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
129129 |
130130LL | declval::<Box<Box<Box<Box<[u8]>>>>>().as_ptr();
131131 | ------------------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -136,7 +136,7 @@ LL | declval::<Box<Box<Box<Box<[u8]>>>>>().as_ptr();
136136 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
137137
138138error: 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
140140 |
141141LL | declval::<Cell<u8>>().as_ptr();
142142 | --------------------- ^^^^^^ this pointer will immediately be invalid
@@ -147,7 +147,7 @@ LL | declval::<Cell<u8>>().as_ptr();
147147 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
148148
149149error: 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
151151 |
152152LL | declval::<MaybeUninit<u8>>().as_ptr();
153153 | ---------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -158,7 +158,7 @@ LL | declval::<MaybeUninit<u8>>().as_ptr();
158158 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
159159
160160error: 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
162162 |
163163LL | declval::<Vec<AsPtrFake>>().as_ptr();
164164 | --------------------------- ^^^^^^ this pointer will immediately be invalid
@@ -168,5 +168,27 @@ LL | declval::<Vec<AsPtrFake>>().as_ptr();
168168 = 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
169169 = help: for more information, see <https://doc.rust-lang.org/reference/destructors.html>
170170
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
172194
0 commit comments