Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E0046 should give missing methods prototypes #36534

Closed
kali opened this issue Sep 16, 2016 · 8 comments
Closed

E0046 should give missing methods prototypes #36534

kali opened this issue Sep 16, 2016 · 8 comments

Comments

@kali
Copy link
Contributor

kali commented Sep 16, 2016

It would be great if the error message was giving the whole prototype of the missing methods, ready to be cut-and-pasted (scalac does it).

cc @jonathandturner

@sophiajt
Copy link
Contributor

@kali - would #36371 (comment) do something similar to what you're looking for?

@kali
Copy link
Contributor Author

kali commented Sep 16, 2016

Yep, exactly. I think we can call this one a dup.

@sophiajt
Copy link
Contributor

Sounds good.

@sophiajt
Copy link
Contributor

(dup of #36371 (comment))

@RReverser
Copy link
Contributor

@jonathandturner Looks like #36371 was a PR not an issue, and it was closed without merging. Should this issue be reopened until some PR fixes it?

@sophiajt
Copy link
Contributor

Pinging @estebank, who is working on errors

@estebank
Copy link
Contributor

The current output is improved over that PR's proposal:

error[E0046]: not all trait items implemented, missing: `fmt`
  --> src/main.rs:17:1
   |
17 | impl std::fmt::Display for A {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
   |
   = note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`

error[E0046]: not all trait items implemented, missing: `Err`, `from_str`
  --> src/main.rs:19:1
   |
19 | impl FromStr for A{}
   | ^^^^^^^^^^^^^^^^^^ missing `Err`, `from_str` in implementation
   |
   = note: `Err` from trait: `type Err;`
   = note: `from_str` from trait: `fn(&str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err>`

error[E0046]: not all trait items implemented, missing: `Foo`, `foo`, `bar`, `bay`
  --> src/main.rs:21:1
   |
6  |       type Foo;
   |       --------- `Foo` from trait
...
9  |       fn foo() -> T;
   |       -------------- `foo` from trait
10 |       fn bar();
   |       --------- `bar` from trait
11 | /     fn    bay<
12 | |         'lifetime,    TypeParameterA
13 | |             >(  a   : usize,
14 | |                 b: u8  );
   | |_________________________- `bay` from trait
...
21 |   impl X<usize> for A {
   |   ^^^^^^^^^^^^^^^^^^^ missing `Foo`, `foo`, `bar`, `bay` in implementation

It's not exactly cut-and-paste, but it provides enough information to fix the problem.

@RReverser
Copy link
Contributor

Yeah it's improved, but for complex signatures from external crates cut and paste would be still helpful (which is what this issue was about I believe).

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

No branches or pull requests

4 participants