-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustc_resolve: don't allow paths starting with ::crate
.
#53347
Conversation
This comment has been minimized.
This comment has been minimized.
cc @nikomatsakis If we go down this path, chalk at least needs to be updated. |
Implementation looks good to me, but I'd like to wait for other people's opinions. I've seen an argument that macro m($crate_name: ident) {
::$crate_name::something();
}
m!(my_crate); // OK
m!(crate); // OK |
@petrochenkov Doesn't seem that hard to write I don't have any fundamental objection to |
Yes, this should be possible when #48067 is implemented (paths cannot be easily concatenated in macros right now). Anyway, prohibiting |
Fixes dependency issue in rust-lang/rust#53347.
fd8ab07
to
2c4a2fc
Compare
This comment has been minimized.
This comment has been minimized.
Do we have a label "ping @rust-lang/lang, wait for a few days and then r+ even if nobody responded"? |
We discussed this in a previous meeting and I got the impression that there was consensus around |
I second @cramertj. |
This still needs its build failures fixed ( |
2c4a2fc
to
9347bf7
Compare
@bors r=petrochenkov |
📌 Commit 9347bf78aaadf67967bd03b144bce9cf99850203 has been approved by |
This comment has been minimized.
This comment has been minimized.
9347bf7
to
be90514
Compare
@bors r=petrochenkov |
📌 Commit be90514154a4202ba27a0be50d64ff4fe193c61c has been approved by |
🔒 Merge conflict This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again. How do I rebase?Assuming
You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial. Please avoid the "Resolve conflicts" button on GitHub. It uses Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Error message
|
be90514
to
9b1d3c7
Compare
@bors r=petrochenkov |
📌 Commit 9b1d3c7 has been approved by |
rustc_resolve: don't allow paths starting with `::crate`. cc @aturon @joshtriplett r? @petrochenkov
Rollup of 11 pull requests Successful merges: - #52858 (Implement Iterator::size_hint for Elaborator.) - #53321 (Fix usage of `wasm_target_feature`) - #53326 ([nll] add regression test for issue #27868) - #53347 (rustc_resolve: don't allow paths starting with `::crate`.) - #53349 ([nll] add tests for #48697 and #30104) - #53357 (Pretty print btreemap for GDB) - #53358 (`{to,from}_{ne,le,be}_bytes` for unsigned integer types) - #53406 (Do not suggest conversion method that is already there) - #53407 (make more ported compile fail tests more robust w.r.t. NLL) - #53413 (Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.) - #53434 (wasm: Remove --strip-debug argument to LLD) Failed merges: r? @ghost
Being conservative here is fine, especially now that |
@rpjohnst The current interpretation isn't that, but rather that |
I get that interpretation, but the |
@rpjohnst Note that we can't make that work in Rust 2015, because there is no place (in the "module tree", so to speak) where you can just "access crates by their name". In Rust 2018 that's the topmost path level, but in Rust 2015 it doesn't exist, and if we allow |
Yeah, 2015 does make it messier. But perhaps allowing We could also allow Regardless, |
cc @aturon @joshtriplett
r? @petrochenkov