You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a given file `foo.rs`:
```rust
use std::str::FromStr;
struct A {}
trait X<T> {
type Foo;
const BAR: u32 = 128;
fn foo() -> T;
fn bar();
fn bay<
'lifetime, TypeParameterA
>( a : usize,
b: u8 );
}
impl std::fmt::Display for A {
}
impl FromStr for A{}
impl X<usize> for A {
}
```
Provide the following output:
```bash
error: main function not found
error[E0046]: not all trait items implemented, missing: `fmt`
--> foo.rs:18:1
|
18 | impl std::fmt::Display for A {
| ^ missing `fmt` in implementation
|
= note: fn fmt(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>;
error[E0046]: not all trait items implemented, missing: `Err`, `from_str`
--> foo.rs:20:1
|
20 | impl FromStr for A{}
| ^^^^^^^^^^^^^^^^^^^^ missing `Err`, `from_str` in implementation
|
= note: type Err;
= note: fn from_str(&str) -> std::result::Result<Self, <Self as std::str::FromStr>::Err>;
error[E0046]: not all trait items implemented, missing: `Foo`, `foo`, `bar`, `bay`
--> foo.rs:22:1
|
22 | impl X<usize> for A {
| ^ missing `Foo`, `foo`, `bar`, `bay` in implementation
|
= note: type Foo;
= note: fn foo() -> T;
= note: fn bar();
= note: fn bay<'lifetime, TypeParameterA>(a: usize, b: u8);
error: aborting due to 3 previous errors
```
Fixes#24626
For a given file `foo.rs`:
```rust
struct A {}
impl std::fmt::Display for A {
fn fmt() -> () {}
}
```
provide the expected method signature:
```bash
error: main function not found
error[E0186]: method `fmt` has a `&self` declaration in the trait, but not in the impl
--> foo.rs:4:5
|
4 | fn fmt() -> () {}
| ^^^^^^^^^^^^^^^^^ expected `&self` in impl
|
= note: Expected signature: fn fmt(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>;
= note: Found signature: fn fmt();
error: aborting due to previous error
```
Fixes#28011
0 commit comments