diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2023-05-17 19:11:55 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-17 19:11:55 +0530 |
| commit | 291ced5e9a9cfb423793cf065f873d2171c19c6a (patch) | |
| tree | d0eccf41d4ebd63b5fdb950e47bd7d67e8f0e95d /tests/ui/resolve | |
| parent | 703323e490a6260ab2dd3fdfb6d5db0dde0dc383 (diff) | |
| parent | db645124221a1e2d3e70b14fbedef019e036c066 (diff) | |
| download | rust-291ced5e9a9cfb423793cf065f873d2171c19c6a.tar.gz rust-291ced5e9a9cfb423793cf065f873d2171c19c6a.zip | |
Rollup merge of #111588 - MU001999:diag/improve-e0782, r=fee1-dead
Emits E0599 when meeting `MyTrait::missing_method` Fixes #111312
Diffstat (limited to 'tests/ui/resolve')
| -rw-r--r-- | tests/ui/resolve/issue-111312.rs | 11 | ||||
| -rw-r--r-- | tests/ui/resolve/issue-111312.stderr | 15 |
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/resolve/issue-111312.rs b/tests/ui/resolve/issue-111312.rs new file mode 100644 index 00000000000..acea37b358b --- /dev/null +++ b/tests/ui/resolve/issue-111312.rs @@ -0,0 +1,11 @@ +// edition: 2021 + +trait Has { + fn has() {} +} + +trait HasNot {} + +fn main() { + HasNot::has(); //~ ERROR +} diff --git a/tests/ui/resolve/issue-111312.stderr b/tests/ui/resolve/issue-111312.stderr new file mode 100644 index 00000000000..4c864029c98 --- /dev/null +++ b/tests/ui/resolve/issue-111312.stderr @@ -0,0 +1,15 @@ +error[E0599]: no function or associated item named `has` found for trait `HasNot` + --> $DIR/issue-111312.rs:10:13 + | +LL | HasNot::has(); + | ^^^ function or associated item not found in `HasNot` + | +note: `Has` defines an item `has` + --> $DIR/issue-111312.rs:3:1 + | +LL | trait Has { + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. |
