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.
Incomplete error message #645
Open
Description
Hi 👋 I'm new to Rust, and ran into an issue that I got confused about that I reported in the main language repo, but it turned out to be this extension.
The error message highlighted in the editor hover (see screenshot) truncated important error details from the terminal output:
but running cargo test
in the terminal correctly reported the full message:
error[E0599]: no method named `try_into` found for type `u32` in the current scope
--> src/lib.rs:2:37
|
2 | let mut sieve = vec![true; number.try_into().unwrap()];
| ^^^^^^^^
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use std::convert::TryInto;
|
In case it's not clear comparing the screenshot, part that was truncated contained the setup to try to fix it:
# this was missing
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
|
1 | use std::convert::TryInto;
|
Activity
remidebette commentedon Aug 8, 2020
Hi,
Indeed this is really relevant to beginners.
The rust compiler provides very good recommendations but in this case the programmer does not get the (very easy and relevant) fix to his issue.
To get this insight, in this specific case, he would need to compile his code himself instead of getting the hint directly from the IDE while coding, or read some obscure stackoverflow and github threads (such as the linked rust-lang/rust#47168 (comment))
This would help a lot the beginners.