about summary refs log tree commit diff
path: root/tests/ui/impl-trait
diff options
context:
space:
mode:
authorcodedump <lichuang1982@gmail.com>2025-07-16 23:21:47 +0800
committercodedump <lichuang1982@gmail.com>2025-07-17 19:26:39 +0800
commitf2048019718409885ac57c480f010bdfbfe5bfd0 (patch)
tree9002030d93d4cab2c7b30fc22483f6d2dd7fe760 /tests/ui/impl-trait
parenta9fb6103b05c6ad6eee6bed4c0bb5a2e8e1024c6 (diff)
downloadrust-f2048019718409885ac57c480f010bdfbfe5bfd0.tar.gz
rust-f2048019718409885ac57c480f010bdfbfe5bfd0.zip
fix: fix issue 143740, Wrong messages from compiler confusing methods with the same name from different traits
Diffstat (limited to 'tests/ui/impl-trait')
-rw-r--r--tests/ui/impl-trait/call_method_without_import.no_import.stderr7
-rw-r--r--tests/ui/impl-trait/no-method-suggested-traits.stderr8
2 files changed, 1 insertions, 14 deletions
diff --git a/tests/ui/impl-trait/call_method_without_import.no_import.stderr b/tests/ui/impl-trait/call_method_without_import.no_import.stderr
index e59409ea27e..dbac74b2247 100644
--- a/tests/ui/impl-trait/call_method_without_import.no_import.stderr
+++ b/tests/ui/impl-trait/call_method_without_import.no_import.stderr
@@ -22,15 +22,10 @@ LL |         x.fmt(f);
    = help: items from traits can only be used if the trait is in scope
 help: the following traits which provide `fmt` are implemented but not in scope; perhaps you want to import one of them
    |
-LL + use std::fmt::Binary;
-   |
 LL + use std::fmt::Debug;
    |
-LL + use std::fmt::Display;
-   |
-LL + use std::fmt::LowerExp;
+LL + use std::fmt::Pointer;
    |
-   = and 5 other candidates
 
 error: aborting due to 2 previous errors
 
diff --git a/tests/ui/impl-trait/no-method-suggested-traits.stderr b/tests/ui/impl-trait/no-method-suggested-traits.stderr
index 061c9bd8f35..b376f205411 100644
--- a/tests/ui/impl-trait/no-method-suggested-traits.stderr
+++ b/tests/ui/impl-trait/no-method-suggested-traits.stderr
@@ -9,12 +9,8 @@ help: the following traits which provide `method` are implemented but not in sco
    |
 LL + use foo::Bar;
    |
-LL + use no_method_suggested_traits::Reexported;
-   |
 LL + use no_method_suggested_traits::foo::PubPub;
    |
-LL + use no_method_suggested_traits::qux::PrivPub;
-   |
 help: there is a method `method2` with a similar name
    |
 LL |     1u32.method2();
@@ -31,12 +27,8 @@ help: the following traits which provide `method` are implemented but not in sco
    |
 LL + use foo::Bar;
    |
-LL + use no_method_suggested_traits::Reexported;
-   |
 LL + use no_method_suggested_traits::foo::PubPub;
    |
-LL + use no_method_suggested_traits::qux::PrivPub;
-   |
 help: there is a method `method2` with a similar name
    |
 LL |     std::rc::Rc::new(&mut Box::new(&1u32)).method2();