Closed
Description
Given the following code: link
struct Foo;
impl Foo {
fn get() -> u8 {
42
}
}
fn main() {
let res: Result<_, ()> = Ok(Foo);
res.get();
}
The current output is:
error[E0599]: no method named `get` found for enum `Result` in the current scope
--> src/main.rs:11:9
|
11 | res.get();
| ^^^ method not found in `Result<Foo, ()>`
For more information about this error, try `rustc --explain E0599`.
Ideally the output should look like:
error[E0599]: no method named `get` found for enum `Result` in the current scope
--> src/main.rs:11:9
|
11 | res.get();
| ^^^ method not found in `Result<Foo, ()>`
note: `Result<Foo, ()>`'s success value, `Foo`, has a method named `get`.
note: To get to the success value of a Result, the error case must be handled first.
For more information about this error, try `rustc --explain E0599`.