rust-lang/vscode-rust

Unexpected error when using std::rc::Rc;

syheliel opened this issue · 3 comments

Here is my code, which can be compiled in the command line:

fn main() {
    pub use std::rc::Rc;
    let five = Rc::new(5);
    let five2 = five.clone();
    let five3 = five.clone();
    println!("{:?}",five);
    println!("{:?}",five2);
    println!("{:?}",five3);
}

But error will appear in two lines : let five = Rc::new(5); and let five2 = five.clone();

cannot find type `Rc` in this scope(E0412)

You might want to try https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer, which doesn't have this issue.

@lnicola thanks! that fixed my problem. But what's the relationship between plugin rust and rust-analyzer? Does rust stop maintaining?