diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-06-19 09:15:16 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-19 09:15:16 -0700 |
| commit | b443a107f8bb851bce4a9d7fb6fc0dd3fca17d9e (patch) | |
| tree | b5aa40a68a23ca20476365bbebb005c38329def0 /src/test | |
| parent | 687f929c9b320fcd11097aee2778e2fc81fa8536 (diff) | |
| parent | 8956a7f58194b5a3a8de944ea1dc1b3b44a070ac (diff) | |
Rollup merge of #73382 - Aaron1011:fix/self-receiver-candidates, r=petrochenkov
Only display other method receiver candidates if they actually apply Previously, we would suggest `Box<Self>` as a valid receiver, even if method resolution only succeeded due to an autoderef (e.g. to `&self`)
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/impl-trait/no-method-suggested-traits.stderr | 18 | ||||
| -rw-r--r-- | src/test/ui/traits/trait-item-privacy.stderr | 7 |
2 files changed, 0 insertions, 25 deletions
diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr index b5135b53e18..3cd4d0dd391 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr +++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr @@ -49,14 +49,6 @@ LL | use foo::Bar; error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&char>>` in the current scope --> $DIR/no-method-suggested-traits.rs:32:43 | -LL | fn method(&self) {} - | ------ - | | - | the method is available for `std::boxed::Box<std::rc::Rc<&mut std::boxed::Box<&char>>>` here - | the method is available for `std::pin::Pin<std::rc::Rc<&mut std::boxed::Box<&char>>>` here - | the method is available for `std::sync::Arc<std::rc::Rc<&mut std::boxed::Box<&char>>>` here - | the method is available for `std::rc::Rc<std::rc::Rc<&mut std::boxed::Box<&char>>>` here -... LL | std::rc::Rc::new(&mut Box::new(&'a')).method(); | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&char>>` | @@ -83,16 +75,6 @@ error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::b | LL | std::rc::Rc::new(&mut Box::new(&1i32)).method(); | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&i32>>` - | - ::: $DIR/auxiliary/no_method_suggested_traits.rs:8:12 - | -LL | fn method(&self) {} - | ------ - | | - | the method is available for `std::boxed::Box<std::rc::Rc<&mut std::boxed::Box<&i32>>>` here - | the method is available for `std::pin::Pin<std::rc::Rc<&mut std::boxed::Box<&i32>>>` here - | the method is available for `std::sync::Arc<std::rc::Rc<&mut std::boxed::Box<&i32>>>` here - | the method is available for `std::rc::Rc<std::rc::Rc<&mut std::boxed::Box<&i32>>>` here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/trait-item-privacy.stderr index 7fd5c11fcf0..3be4f110973 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/trait-item-privacy.stderr @@ -20,13 +20,6 @@ error[E0599]: no method named `b` found for struct `S` in the current scope LL | struct S; | --------- method `b` not found for this ... -LL | fn b(&self) { } - | - - | | - | the method is available for `std::boxed::Box<S>` here - | the method is available for `std::sync::Arc<S>` here - | the method is available for `std::rc::Rc<S>` here -... LL | S.b(); | ^ method not found in `S` | |
