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
Restrict sysroot crate imports to those defined in this repo.
It's common to import dependencies from the sysroot via `extern crate`
rather than use an explicit cargo dependency, when it's necessary to use
the same dependency version as used by rustc itself. However, this is
dangerous for crates.io crates, since rustc may not pull in the
dependency on some targets, or may pull in multiple versions. In both
cases, the `extern crate` fails to resolve.
To address this, re-export all such dependencies from the appropriate
`rustc_*` crates, and use this alias from crates which would otherwise
need to use `extern crate`.
Copy file name to clipboardExpand all lines: compiler/rustc_lint/messages.ftl
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -199,6 +199,9 @@ lint_dangling_pointers_from_locals = a dangling pointer will be produced because
199
199
.created_at = dangling pointer created here
200
200
.note = pointers do not have a lifetime; after returning, the `{$local_var_ty}` will be deallocated at the end of the {$fn_kind} because nothing is referencing it as far as the type system is concerned
201
201
202
+
lint_dangerous_extern_crate = dangerous use of `extern crate {$name}` which is not guaranteed to exist exactly once in the sysroot
203
+
.help = try using a cargo dependency or using a re-export of the dependency provided by a rustc_* crate
204
+
202
205
lint_dangling_pointers_from_temporaries = a dangling pointer will be produced because the temporary `{$ty}` will be dropped
203
206
.label_ptr = this pointer will immediately be invalid
204
207
.label_temporary = this `{$ty}` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
0 commit comments