diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-05-31 23:14:43 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-06-04 12:52:55 -0700 |
| commit | e324919ec57954adaa49884e5894bc7d615d413e (patch) | |
| tree | a9134bffb3b550f7263c54a46b4909612eb0b7fb /src/test/run-pass/thinlto | |
| parent | 4ed2edaafe82fb8d44e81e00ca3e4f7659855ba2 (diff) | |
| download | rust-e324919ec57954adaa49884e5894bc7d615d413e.tar.gz rust-e324919ec57954adaa49884e5894bc7d615d413e.zip | |
Show trait method signature when impl differs
When the trait's span is available, it is already being used, add a
`note` for the cases where the span isn't available:
```
error[E0053]: method `fmt` has an incompatible type for trait
--> $DIR/trait_type.rs:17:4
|
17 | fn fmt(&self, x: &str) -> () { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability
|
= note: expected type `fn(&MyType, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
found type `fn(&MyType, &str)`
error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2
--> $DIR/trait_type.rs:21:11
|
21 | fn fmt(&self) -> () { }
| ^^^^^ expected 2 parameters, found 1
|
= note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
--> $DIR/trait_type.rs:25:4
|
25 | fn fmt() -> () { }
| ^^^^^^^^^^^^^^^^^^ expected `&self` in impl
|
= note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
error[E0046]: not all trait items implemented, missing: `fmt`
--> $DIR/trait_type.rs:28:1
|
28 | impl std::fmt::Display for MyType4 {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `fmt` in implementation
|
= note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
```
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
