-
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
2018 edition allows ungated access to unstable crates #52489
Comments
@rust-lang/compiler Can we get some eyes on this, not necessarily to fix but at least to confirm that we believe a fix can be made and landed in time for RC? This is a hard-stop blocker for RC. |
So this is generally harmless (you can't actually get anything from the unstable crate), except for it being a minor dead-code-but-allowed hazard. The culprit appears to be this special-casing: rust/src/librustc_resolve/resolve_imports.rs Lines 635 to 641 in e94df4a
Which loads the crate (producing an error if no crate with that name exists), but doesn't record the resolution. So there's nothing to check - and presumably no way to use that broken import. The part that's missing is this (recording the import resolutions): rust/src/librustc_resolve/resolve_imports.rs Lines 878 to 884 in e94df4a
But the special-casing exits early: rust/src/librustc_resolve/resolve_imports.rs Lines 693 to 694 in e94df4a
Expected minimal diff (between the two lines in the last snippet): let import = self.import_map.entry(directive.id).or_default();
import[TypeNS] = Some(PathResolution::new(binding.def())); |
rustc_resolve: record single-segment extern crate import resolutions. Fixes rust-lang#52489 by recording special-cased single-segment imports for later (e.g. stability) checks. cc @alexcrichton @Mark-Simulacrum @petrochenkov Does this need to be backported?
rustc_resolve: record single-segment extern crate import resolutions. Fixes rust-lang#52489 by recording special-cased single-segment imports for later (e.g. stability) checks. cc @alexcrichton @Mark-Simulacrum @petrochenkov Does this need to be backported?
When compiled with
--edition 2018
this code compiles just fine:That's bad!
The text was updated successfully, but these errors were encountered: