-
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
unstable alloc
crate can be used without feature gates on the 2018 edition
#54006
Comments
Marking as P-high due to edition urgency. |
@alexcrichton Uhhhh this is because we can't stability-check intermediary path components. cc @petrochenkov This seems much worse than usual. OTOH, I do have a branch where you have to use |
Ah yes, indeed! The "intermediary path components stability doesn't work" has never been high priority because the root crate always had to be listed as |
Can't we check the stability when we do the lazy path resolution? |
Sorry, that's not very clear. What I meant is: Can we do the stability checking when we first load the crate? |
Visited for triage. Assigning to @eddyb, who sounds like they are on the case. |
Another question: Can you specify |
(If you invoke rustc manually, or maybe by cajoling cargo sufficiently) |
@nikomatsakis The only way you can access the sysroot crate without knowing its path is the new We can't check stability when we load the crate, because that happens before the query engine is set up, and it's a pretty messy right now to get any useful information across. What we could do is try to get a stability check into #54145. |
rustc_resolve: allow only core, std, meta and --extern in Rust 2018 paths. As per #53166 (comment): * Rust 2018 imports can no longer refer to crates not in "extern prelude" * `::foo` won't load a crate named `foo` unless `foo` is in the "extern prelude" * `extern crate foo;`, however, remains unchanged (can load arbitrary crates) * `--extern crate_name` is added (note the lack of `=path`) as an unstable option * adds `crate_name` to the "extern prelude" (see above) * crate is searched in sysroot & library paths, just like `extern crate crate_name`. * `Cargo` support will be added later * `core`, `std` and ~~`proc_macro`~~ `meta` are *always* available in the extern prelude * warning for interaction with `no_std` / `no_core` will be added later * **EDIT**: `proc_macro` was replaced by `meta`, see #53166 (comment) * note that there is no crate named `meta` being added, so `use meta::...;` will fail, we're only whitelisting it so we can start producing `uniform_paths` compatibility errors Fixes #54006 (as the example now requires `--extern alloc`, which is unstable). Fixes #54253 (hit during fixing RLS). r? @petrochenkov cc @aturon @alexcrichton @Centril @joshtriplett
STR
This compiles when
edition = "2018"
This doesn't compile when
edition = "2015"
because it needs a feature gate.Meta
The text was updated successfully, but these errors were encountered: