Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Incomplete error message #645

Open
bbugh opened this issue Aug 12, 2019 · 1 comment
Open

Incomplete error message #645

bbugh opened this issue Aug 12, 2019 · 1 comment

Comments

@bbugh
Copy link

bbugh commented Aug 12, 2019

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:

image

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;
  |
@remidebette
Copy link

remidebette commented 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants