Skip to content

fix: fix issue 143740, Wrong messages from compiler confusing methods… #144029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lichuang
Copy link

fix issue #143740

@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 16, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

Please squash this into one commit

@rustbot author
r? compiler-errors

@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 16, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 16, 2025
@rustbot rustbot assigned compiler-errors and unassigned fee1-dead Jul 16, 2025
@lichuang
Copy link
Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 17, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:

---- [ui] tests/ui/impl-trait/call_method_without_import.rs#no_import stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/impl-trait/call_method_without_import.no_import/call_method_without_import.no_import.stderr`
diff of stderr:

22    = help: items from traits can only be used if the trait is in scope
23 help: the following traits which provide `fmt` are implemented but not in scope; perhaps you want to import one of them
24    |
---
To only update this specific test, also pass `--test-args impl-trait/call_method_without_import.rs`

error in revision `no_import`: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/call_method_without_import.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--cfg" "no_import" "--check-cfg" "cfg(test,FALSE,import,no_import)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/impl-trait/call_method_without_import.no_import" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0599]: no method named `fmt` found for opaque type `impl Debug` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/call_method_without_import.rs:17:11
   |
---
10 LL + use foo::Bar;
11    |
- LL + use no_method_suggested_traits::Reexported;
-    |
14 LL + use no_method_suggested_traits::foo::PubPub;
15    |
- LL + use no_method_suggested_traits::qux::PrivPub;
-    |
18 help: there is a method `method2` with a similar name
19    |
20 LL |     1u32.method2();

31    |
32 LL + use foo::Bar;
33    |
- LL + use no_method_suggested_traits::Reexported;
-    |
36 LL + use no_method_suggested_traits::foo::PubPub;
-    |
- LL + use no_method_suggested_traits::qux::PrivPub;
39    |
40 help: there is a method `method2` with a similar name
41    |


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args impl-trait/no-method-suggested-traits.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/impl-trait/no-method-suggested-traits.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/impl-trait/no-method-suggested-traits" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/impl-trait/no-method-suggested-traits/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0599]: no method named `method` found for type `u32` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:25:10
   |
LL |     1u32.method();
   |          ^^^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: the following traits which provide `method` are implemented but not in scope; perhaps you want to import one of them
   |
LL + use foo::Bar;
   |
LL + use no_method_suggested_traits::foo::PubPub;
   |
help: there is a method `method2` with a similar name
   |
LL |     1u32.method2();
   |                +

error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:28:44
   |
LL |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
   |                                            ^^^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: the following traits which provide `method` are implemented but not in scope; perhaps you want to import one of them
   |
LL + use foo::Bar;
   |
LL + use no_method_suggested_traits::foo::PubPub;
   |
help: there is a method `method2` with a similar name
   |
LL |     std::rc::Rc::new(&mut Box::new(&1u32)).method2();
   |                                                  +

error[E0599]: no method named `method` found for type `char` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:32:9
   |
LL |         fn method(&self) {}
   |            ------ the method is available for `char` here
...
LL |     'a'.method();
   |         ^^^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: trait `Bar` which provides `method` is implemented but not in scope; perhaps you want to import it
   |
LL + use foo::Bar;
   |
help: there is a method `method2` with a similar name
   |
LL |     'a'.method2();
   |               +

error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:34:43
   |
LL |     std::rc::Rc::new(&mut Box::new(&'a')).method();
   |                                           ^^^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: trait `Bar` which provides `method` is implemented but not in scope; perhaps you want to import it
   |
LL + use foo::Bar;
   |
help: there is a method `method2` with a similar name
   |
LL |     std::rc::Rc::new(&mut Box::new(&'a')).method2();
   |                                                 +

error[E0599]: no method named `method` found for type `i32` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:37:10
   |
LL |     1i32.method();
   |          ^^^^^^
   |
  ::: /checkout/tests/ui/impl-trait/auxiliary/no_method_suggested_traits.rs:8:12
   |
LL |         fn method(&self) {}
   |            ------ the method is available for `i32` here
   |
   = help: items from traits can only be used if the trait is in scope
help: trait `PubPub` which provides `method` is implemented but not in scope; perhaps you want to import it
   |
LL + use no_method_suggested_traits::foo::PubPub;
   |
help: there is a method `method3` with a similar name
   |
LL |     1i32.method3();
   |                +

error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:39:44
   |
LL |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
   |                                            ^^^^^^
   |
   = help: items from traits can only be used if the trait is in scope
help: trait `PubPub` which provides `method` is implemented but not in scope; perhaps you want to import it
   |
LL + use no_method_suggested_traits::foo::PubPub;
   |
help: there is a method `method3` with a similar name
   |
LL |     std::rc::Rc::new(&mut Box::new(&1i32)).method3();
   |                                                  +

error[E0599]: no method named `method` found for struct `Foo` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:42:9
   |
LL | struct Foo;
   | ---------- method `method` not found for this struct
...
LL |     Foo.method();
   |         ^^^^^^ method not found in `Foo`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following traits define an item `method`, perhaps you need to implement one of them:
           candidate #1: `foo::Bar`
           candidate #2: `PubPub`
           candidate #3: `Reexported`
           candidate #4: `no_method_suggested_traits::qux::PrivPub`

error[E0599]: no method named `method` found for struct `Rc<&mut Box<&Foo>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:44:43
   |
LL |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
   |                                           ^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following traits define an item `method`, perhaps you need to implement one of them:
           candidate #1: `foo::Bar`
           candidate #2: `PubPub`
           candidate #3: `Reexported`
           candidate #4: `no_method_suggested_traits::qux::PrivPub`

error[E0599]: no method named `method2` found for type `u64` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:47:10
   |
LL |     1u64.method2();
   |          ^^^^^^^ method not found in `u64`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:10:5
   |
LL |     pub trait Bar {
   |     ^^^^^^^^^^^^^

error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&u64>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:49:44
   |
LL |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
   |                                            ^^^^^^^ method not found in `Rc<&mut Box<&u64>>`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:10:5
   |
LL |     pub trait Bar {
   |     ^^^^^^^^^^^^^

error[E0599]: no method named `method2` found for struct `no_method_suggested_traits::Foo` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:52:37
   |
LL |     no_method_suggested_traits::Foo.method2();
   |                                     ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:10:5
   |
LL |     pub trait Bar {
   |     ^^^^^^^^^^^^^

error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:54:71
   |
LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
   |                                                                       ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Foo>>`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:10:5
   |
LL |     pub trait Bar {
   |     ^^^^^^^^^^^^^

error[E0599]: no method named `method2` found for enum `no_method_suggested_traits::Bar` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:56:40
   |
LL |     no_method_suggested_traits::Bar::X.method2();
   |                                        ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:10:5
   |
LL |     pub trait Bar {
   |     ^^^^^^^^^^^^^

error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:58:74
   |
LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
   |                                                                          ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Bar>>`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:10:5
   |
LL |     pub trait Bar {
   |     ^^^^^^^^^^^^^

error[E0599]: no method named `method3` found for struct `Foo` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:61:9
   |
LL | struct Foo;
   | ---------- method `method3` not found for this struct
...
LL |     Foo.method3();
   |         ^^^^^^^ method not found in `Foo`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `method3`, perhaps you need to implement it:
           candidate #1: `PubPub`

error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Foo>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:63:43
   |
LL |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
   |                                           ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `method3`, perhaps you need to implement it:
           candidate #1: `PubPub`

error[E0599]: no method named `method3` found for enum `Bar` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:65:12
   |
LL | enum Bar { X }
   | -------- method `method3` not found for this enum
...
LL |     Bar::X.method3();
   |            ^^^^^^^ method not found in `Bar`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `method3`, perhaps you need to implement it:
           candidate #1: `PubPub`

error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Bar>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:67:46
   |
LL |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
   |                                              ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>`
   |
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `method3`, perhaps you need to implement it:
           candidate #1: `PubPub`

error[E0599]: no method named `method3` found for type `usize` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:71:13
   |
LL |     1_usize.method3(); //~ ERROR no method named
   |             ^^^^^^^ method not found in `usize`

error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&usize>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:72:47
   |
LL |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR no method named
   |                                               ^^^^^^^ method not found in `Rc<&mut Box<&usize>>`

error[E0599]: no method named `method3` found for struct `no_method_suggested_traits::Foo` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:73:37
   |
LL |     no_method_suggested_traits::Foo.method3();  //~ ERROR no method named
   |                                     ^^^^^^^ method not found in `no_method_suggested_traits::Foo`

error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:74:71
   |
LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
   |                                                                       ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Foo>>`

error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:76:40
   |
LL |     no_method_suggested_traits::Bar::X.method3();  //~ ERROR no method named
   |                                        ^^^^^^^ method not found in `no_method_suggested_traits::Bar`

error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope
##[error]  --> /checkout/tests/ui/impl-trait/no-method-suggested-traits.rs:77:74
   |
LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
   |                                                                          ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Bar>>`

error: aborting due to 24 previous errors

For more information about this error, try `rustc --explain E0599`.
------------------------------------------


---- [ui] tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/methods/method-deref-to-same-trait-object-with-separate-params/method-deref-to-same-trait-object-with-separate-params.stderr`
diff of stderr:

20 LL |     let z = x.foo();
21    |               ^^^ multiple `foo` found
22    |
- note: candidate #1 is defined in the trait `FinalFoo`
-   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:60:5
-    |
- LL |     fn foo(&self) -> u8;
-    |     ^^^^^^^^^^^^^^^^^^^^
- note: candidate #2 is defined in an impl of the trait `NuisanceFoo` for the type `T`
+ note: candidate #1 is defined in an impl of the trait `NuisanceFoo` for the type `T`
29   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:73:9
30    |
31 LL |         fn foo(self) {}

32    |         ^^^^^^^^^^^^
- note: candidate #3 is defined in an impl of the trait `X` for the type `T`
+ note: candidate #2 is defined in an impl of the trait `X` for the type `T`
34   --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:46:9
35    |
36 LL |         fn foo(self: Smaht<Self, u64>) -> u64 {

38 help: disambiguate the method for candidate #1
39    |
40 LL -     let z = x.foo();
- LL +     let z = FinalFoo::foo(&x);
-    |
- help: disambiguate the method for candidate #2
-    |
- LL -     let z = x.foo();
46 LL +     let z = NuisanceFoo::foo(x);
47    |
- help: disambiguate the method for candidate #3
+ help: disambiguate the method for candidate #2
49    |
50 LL -     let z = x.foo();
51 LL +     let z = X::foo(x);


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args methods/method-deref-to-same-trait-object-with-separate-params.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/methods/method-deref-to-same-trait-object-with-separate-params" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:88:24
   |
LL |     let _seetype: () = z; //~ ERROR mismatched types
   |                   --   ^ expected `()`, found `u32`
   |                   |
   |                   expected due to this

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:105:24
   |
LL |     let _seetype: () = z; //~ ERROR mismatched types
   |                   --   ^ expected `()`, found `u64`
   |                   |
   |                   expected due to this

error[E0034]: multiple applicable items in scope
##[error]  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:123:15
   |
LL |     let z = x.foo(); //~ ERROR multiple applicable items in scope
   |               ^^^ multiple `foo` found
   |
note: candidate #1 is defined in an impl of the trait `NuisanceFoo` for the type `T`
  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:73:9
   |
LL |         fn foo(self) {}
   |         ^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `X` for the type `T`
  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:46:9
   |
LL |         fn foo(self: Smaht<Self, u64>) -> u64 {
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
   |
LL -     let z = x.foo(); //~ ERROR multiple applicable items in scope
LL +     let z = NuisanceFoo::foo(x); //~ ERROR multiple applicable items in scope
   |
help: disambiguate the method for candidate #2
   |
LL -     let z = x.foo(); //~ ERROR multiple applicable items in scope
LL +     let z = X::foo(x); //~ ERROR multiple applicable items in scope
   |

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:140:24
   |
LL |     let _seetype: () = z; //~ ERROR mismatched types
   |                   --   ^ expected `()`, found `u8`
   |                   |
   |                   expected due to this

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:158:24
   |
LL |     let _seetype: () = z; //~ ERROR mismatched types
   |                   --   ^ expected `()`, found `u32`
   |                   |
   |                   expected due to this

error[E0308]: mismatched types
##[error]  --> /checkout/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs:175:24
   |
LL |     let _seetype: () = z; //~ ERROR mismatched types
   |                   --   ^ expected `()`, found `u32`
   |                   |
   |                   expected due to this

error: aborting due to 6 previous errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants