You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/lint/dangling-pointers-from-temporaries/example-from-issue123613.stderr
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
error: getting a pointer from a temporary `String` will result in a dangling pointer
2
-
--> $DIR/issue123613.rs:5:48
2
+
--> $DIR/example-from-issue123613.rs:5:48
3
3
|
4
4
LL | let str1 = String::with_capacity(MAX_PATH).as_mut_ptr();
5
5
| ------------------------------- ^^^^^^^^^^ this pointer will immediately be invalid
@@ -9,13 +9,13 @@ LL | let str1 = String::with_capacity(MAX_PATH).as_mut_ptr();
9
9
= note: pointers do not have a lifetime; when calling `as_mut_ptr` the `String` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
10
10
= help: for more information, see https://doc.rust-lang.org/reference/destructors.html
11
11
note: the lint level is defined here
12
-
--> $DIR/issue123613.rs:1:9
12
+
--> $DIR/example-from-issue123613.rs:1:9
13
13
|
14
14
LL | #![deny(dangling_pointers_from_temporaries)]
15
15
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16
16
17
17
error: getting a pointer from a temporary `String` will result in a dangling pointer
18
-
--> $DIR/issue123613.rs:7:70
18
+
--> $DIR/example-from-issue123613.rs:7:70
19
19
|
20
20
LL | let str2 = String::from("TotototototototototototototototototoT").as_ptr();
21
21
| ----------------------------------------------------- ^^^^^^ this pointer will immediately be invalid
0 commit comments