-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #119134 - petrochenkov:feedvis2, r=compiler-errors
resolve: Feed visibilities for unresolved trait impl items Fixes #119073
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// edition:2018 | ||
|
||
trait MyTrait { | ||
async fn resolved(&self); | ||
const RESOLVED_WRONG: u8 = 0; | ||
} | ||
|
||
impl MyTrait for i32 { | ||
async fn resolved(&self) {} | ||
|
||
async fn unresolved(&self) {} //~ ERROR method `unresolved` is not a member of trait `MyTrait` | ||
async fn RESOLVED_WRONG() {} //~ ERROR doesn't match its trait `MyTrait` | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0407]: method `unresolved` is not a member of trait `MyTrait` | ||
--> $DIR/unresolved-trait-impl-item.rs:11:5 | ||
| | ||
LL | async fn unresolved(&self) {} | ||
| ^^^^^^^^^----------^^^^^^^^^^ | ||
| | | | ||
| | help: there is an associated function with a similar name: `resolved` | ||
| not a member of trait `MyTrait` | ||
|
||
error[E0324]: item `RESOLVED_WRONG` is an associated method, which doesn't match its trait `MyTrait` | ||
--> $DIR/unresolved-trait-impl-item.rs:12:5 | ||
| | ||
LL | const RESOLVED_WRONG: u8 = 0; | ||
| ----------------------------- item in trait | ||
... | ||
LL | async fn RESOLVED_WRONG() {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ does not match trait | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0324, E0407. | ||
For more information about an error, try `rustc --explain E0324`. |