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
Reduced from RLS' source (on the Rust 2018 edition):
// Dummy import to introduce `uniform_paths` canaries.use std;// fn version() -> &'static str {""}mod foo {// Error *not* reported, despite `version` being commented out above!usecrate::version;fnbar(){version();}}fnmain(){}
The use std; import is the one introducing the canaries - if it's changed to use ::std;, the error for version is emitted. With no import errors, various parts of the compiler can ICE.
(currently attempted .def_id() on invalid def: Err, triggered by lints trying to run on foo::bar)
I'll try to fix it during #54116, as it was discovered during my attempt to fix RLS for that PR.
The text was updated successfully, but these errors were encountered:
eddyb
added
the
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
label
Sep 15, 2018
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
Reduced from RLS' source (on the Rust 2018 edition):
The
use std;
import is the one introducing the canaries - if it's changed touse ::std;
, the error forversion
is emitted. With no import errors, various parts of the compiler can ICE.(currently
attempted .def_id() on invalid def: Err
, triggered by lints trying to run onfoo::bar
)I'll try to fix it during #54116, as it was discovered during my attempt to fix RLS for that PR.
The text was updated successfully, but these errors were encountered: