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: compiler/rustc_error_messages/locales/en-US/lint.ftl
+6
Original file line number
Diff line number
Diff line change
@@ -54,3 +54,9 @@ lint-diag-out-of-impl =
54
54
diagnostics should only be created in `SessionDiagnostic`/`AddSubdiagnostic` impls
55
55
56
56
lint-untranslatable-diag = diagnostics should be created using translatable messages
57
+
58
+
lint-cstring-ptr = getting the inner pointer of a temporary `CString`
59
+
.as-ptr-label = this pointer will be invalid
60
+
.unwrap-label = this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
61
+
.note = pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
62
+
.help = for more information, see https://doc.rust-lang.org/reference/destructors.html
.build("getting the inner pointer of a temporary `CString`");
93
-
diag.span_label(as_ptr_span,"this pointer will be invalid");
94
-
diag.span_label(
95
-
unwrap.span,
96
-
"this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime",
97
-
);
98
-
diag.note("pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned");
99
-
diag.help("for more information, see https://doc.rust-lang.org/reference/destructors.html");
0 commit comments