This repository was archived by the owner on Nov 18, 2022. It is now read-only.
This repository was archived by the owner on Nov 18, 2022. It is now read-only.
Unresolved import
error highlighting when nothing is wrong #513
Open
Description
I was following chapter 12.3 of the Rust book [0]. Particularly this snippet from Listing 12-14:
use std::env;
use std::process;
use minigrep;
use minigrep::Config;
fn main() {
// --snip--
if let Err(e) = minigrep::run(config) {
// --snip--
}
}
However, the VS Code extension threw me some errors:
Upon digging this issue, I found out that prior to the 2018 Edition, the Rust compiler would have caught these issues [1]. After updating Rust to 1.32.0 and adding edition = "2018"
to Cargo.toml
, my code ran just fine in the terminal. Yet, these errors still persist inside VS Code via the Rust extension. Is it just me or the extension never fixes this error?
[0] https://doc.rust-lang.org/book/ch12-03-improving-error-handling-and-modularity.html
[1] rust-lang/book#1676 (comment)