-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Restrict sysroot crate imports to those defined in this repo. #143548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in src/tools/compiletest cc @jieyouxu Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in compiler/rustc_attr_data_structures Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_codegen_gcc The Miri subtree was changed cc @rust-lang/miri Some changes occurred in exhaustiveness checking cc @Nadrieril Some changes occurred in compiler/rustc_sanitizers cc @rcvalle
|
8e8dd82
to
c613bce
Compare
The Miri subtree was changed cc @rust-lang/miri Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Miri changes LGTM, except the ones in the vendored file where only the header at the top should be edited.
I'm fine with having these Miri changes here, seems easier to do this centrally than coordinate half a dozen PRs.
Do you think it is feasible to add an internal lint that rejects |
@oli-obk I'll look into this. How does testing work for sub-trees? Would each sub-tree need its own copy of the lint, or do the subtree repos have some way to run rust-wide lints? |
"internal" lints live in rustc like normal lints, but are gated behind a nightly-only flag. Miri enables them in their CI, I don't know if |
We have a list of internal lints that rustc has and enables everywhere. We'd have to limit it to crates with |
Not sure what you mean about restricting it, the lints need |
Ah right, my bad |
6dd804b
to
8561f09
Compare
This comment has been minimized.
This comment has been minimized.
8561f09
to
2235afc
Compare
This comment has been minimized.
This comment has been minimized.
2235afc
to
8dd8124
Compare
This comment has been minimized.
This comment has been minimized.
8dd8124
to
a79cac5
Compare
This comment has been minimized.
This comment has been minimized.
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`.
a79cac5
to
12fe444
Compare
The job Click to see the possible cause of the failure (guessed by this bot)
|
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, theextern 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 useextern crate
.See #143492 for an example of the kind of issue that can occur.