about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-27 16:37:47 +0100
committerGitHub <noreply@github.com>2022-12-27 16:37:47 +0100
commita0bf4f9b721d7f8cb30cda1bd69491c10a1054db (patch)
tree03f1b337850d9ae0d72fc3827b39cd920304acb5 /src/test
parenta1fc71196a5554eafc5dd9a1b4e0c159717141e0 (diff)
parent90753de099c2e3b2e7d2f84e7ca553a1e987d9ed (diff)
downloadrust-a0bf4f9b721d7f8cb30cda1bd69491c10a1054db.tar.gz
rust-a0bf4f9b721d7f8cb30cda1bd69491c10a1054db.zip
Rollup merge of #105817 - chenyukang:yukang/fix-105788-sugg-for-auto-trait, r=TaKO8Ki
Remove unreasonable help message for auto trait

Fixes #105788
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/methods/issues/issue-105732.rs3
-rw-r--r--src/test/ui/methods/issues/issue-105732.stderr16
2 files changed, 5 insertions, 14 deletions
diff --git a/src/test/ui/methods/issues/issue-105732.rs b/src/test/ui/methods/issues/issue-105732.rs
index 98b7a8d0d04..d7005065813 100644
--- a/src/test/ui/methods/issues/issue-105732.rs
+++ b/src/test/ui/methods/issues/issue-105732.rs
@@ -6,7 +6,8 @@ auto trait Foo {
 
 trait Bar {
     fn f(&self) {
-        self.g(); //~ ERROR the method `g` exists for reference `&Self`, but its trait bounds were not satisfied
+        // issue #105788
+        self.g(); //~ ERROR no method named `g` found for reference `&Self` in the current scope
     }
 }
 
diff --git a/src/test/ui/methods/issues/issue-105732.stderr b/src/test/ui/methods/issues/issue-105732.stderr
index fb2bdf47de7..7696642548d 100644
--- a/src/test/ui/methods/issues/issue-105732.stderr
+++ b/src/test/ui/methods/issues/issue-105732.stderr
@@ -6,21 +6,11 @@ LL | auto trait Foo {
 LL |     fn g(&self);
    |     ---^-------- help: remove these associated items
 
-error[E0599]: the method `g` exists for reference `&Self`, but its trait bounds were not satisfied
-  --> $DIR/issue-105732.rs:9:14
+error[E0599]: no method named `g` found for reference `&Self` in the current scope
+  --> $DIR/issue-105732.rs:10:14
    |
 LL |         self.g();
-   |              ^
-   |
-   = note: the following trait bounds were not satisfied:
-           `Self: Foo`
-           which is required by `&Self: Foo`
-           `&Self: Foo`
-   = help: items from traits can only be used if the type parameter is bounded by the trait
-help: the following trait defines an item `g`, perhaps you need to add a supertrait for it:
-   |
-LL | trait Bar: Foo {
-   |          +++++
+   |              ^ help: there is a method with a similar name: `f`
 
 error: aborting due to 2 previous errors