Closed
Description
Code
extern crate rustc_index;
use rustc_index::{vec::Idx};
fn main() { }
Current output
# rustc --version
rustc 1.73.0-nightly (0bdb00d55 2023-08-15)
# rustc main.rs
error[E0603]: module `vec` is private
--> main.rs:3:19
|
3 | use rustc_index::{vec::Idx};
| ^^^ private module
|
note: the module `vec` is defined here
--> /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/compiler/rustc_index/src/lib.rs:24:1
help: consider importing this trait instead
|
3 | use rustc_index::{rustc_index::Idx};
| ~~~~~~~~~~~~~~~~
error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
--> main.rs:1:1
|
1 | extern crate rustc_index;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
= help: add `#![feature(rustc_private)]` to the crate attributes to enable
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0603, E0658.
For more information about an error, try `rustc --explain E0603`.
(The rustc_private error is irrelevant)
Desired output
The suggestion to import rustc_index::{rustc_index::Idx};
is obviously wrong. It should be rustc_index::{Idx};
(or even rustc_index::Idx
).