From 5799fb419c96a9e6a170f7980f67fd9047fd6f96 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Esteban=20K=C3=BCber?= Date: Fri, 6 Sep 2019 12:00:07 -0700 Subject: [PATCH] Give method not found a primary span label --- src/librustc_typeck/check/method/suggest.rs | 3 ++ src/test/ui/auto-ref-slice-plus-ref.stderr | 6 +-- src/test/ui/class-cast-to-trait.stderr | 2 +- .../coherence/coherence_inherent.old.stderr | 2 +- .../ui/coherence/coherence_inherent.re.stderr | 2 +- .../coherence_inherent_cc.old.stderr | 2 +- .../coherence/coherence_inherent_cc.re.stderr | 2 +- .../invalid-const-arg-for-type-param.stderr | 2 +- src/test/ui/copy-a-resource.stderr | 2 +- .../derives/derive-assoc-type-not-impl.stderr | 2 +- src/test/ui/error-festival.stderr | 2 +- .../ui/hygiene/no_implicit_prelude.stderr | 2 +- src/test/ui/hygiene/trait_items.stderr | 2 +- src/test/ui/impl-trait/bindings-opaque.stderr | 6 +-- ...e-21659-show-relevant-trait-impls-3.stderr | 2 +- .../method-suggestion-no-duplication.stderr | 2 +- .../no-method-suggested-traits.stderr | 48 +++++++++---------- .../ui/infinite/infinite-autoderef.stderr | 2 +- src/test/ui/issues/issue-10465.stderr | 2 +- src/test/ui/issues/issue-13853.stderr | 2 +- src/test/ui/issues/issue-15207.stderr | 2 +- src/test/ui/issues/issue-1871.stderr | 2 +- src/test/ui/issues/issue-19521.stderr | 2 +- src/test/ui/issues/issue-19692.stderr | 2 +- src/test/ui/issues/issue-2149.stderr | 2 +- src/test/ui/issues/issue-21596.stderr | 2 +- src/test/ui/issues/issue-25385.stderr | 4 +- src/test/ui/issues/issue-2823.stderr | 2 +- src/test/ui/issues/issue-29124.stderr | 4 +- src/test/ui/issues/issue-29181.stderr | 2 +- src/test/ui/issues/issue-31173.stderr | 2 +- src/test/ui/issues/issue-34334.stderr | 2 +- src/test/ui/issues/issue-35677.stderr | 2 +- src/test/ui/issues/issue-39175.stderr | 2 +- src/test/ui/issues/issue-41880.stderr | 2 +- src/test/ui/issues/issue-43189.stderr | 2 +- .../option-as_deref_mut.stderr | 2 +- src/test/ui/issues/issue-5153.stderr | 2 +- src/test/ui/issues/issue-54062.stderr | 2 +- src/test/ui/issues/issue-57362-1.stderr | 2 +- .../macro-backtrace-invalid-internals.stderr | 4 +- .../ui/methods/method-call-err-msg.stderr | 2 +- .../ui/mismatched_types/issue-36053-2.stderr | 2 +- .../method-help-unsatisfied-bound.stderr | 2 +- src/test/ui/non-copyable-void.stderr | 2 +- src/test/ui/noncopyable-class.stderr | 2 +- src/test/ui/object-pointer-types.stderr | 6 +-- .../rust-2018/trait-import-suggestions.stderr | 6 +-- ...point-at-arbitrary-self-type-method.stderr | 2 +- ...at-arbitrary-self-type-trait-method.stderr | 2 +- .../ui/shadowed/shadowed-trait-methods.stderr | 2 +- ...pecialization-trait-not-implemented.stderr | 2 +- ...it-with-missing-trait-bounds-in-arg.stderr | 2 +- src/test/ui/suggestions/issue-21673.stderr | 4 +- .../ui/suggestions/suggest-methods.stderr | 2 +- src/test/ui/traits/trait-impl-1.stderr | 2 +- src/test/ui/traits/trait-item-privacy.stderr | 4 +- .../trivial-bounds/trivial-bounds-leak.stderr | 2 +- ...ed-closures-static-call-wrong-trait.stderr | 2 +- src/test/ui/underscore-imports/shadow.stderr | 2 +- src/test/ui/union/union-derive-clone.stderr | 2 +- src/test/ui/unique-object-noncopyable.stderr | 2 +- src/test/ui/unique-pinned-nocopy.stderr | 2 +- 63 files changed, 101 insertions(+), 98 deletions(-) diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 72e6f597159..3e45b1e98d4 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -425,6 +425,9 @@ pub fn report_method_error<'b>( "private field" }; err.span_label(item_name.span, format!("{}, not a method", field_kind)); + } else if lev_candidate.is_none() && static_sources.is_empty() { + err.span_label(span, format!("{} not found in `{}`", item_kind, ty_str)); + self.tcx.sess.trait_methods_not_found.borrow_mut().insert(orig_span); } } else { err.span_label(span, format!("{} not found in `{}`", item_kind, ty_str)); diff --git a/src/test/ui/auto-ref-slice-plus-ref.stderr b/src/test/ui/auto-ref-slice-plus-ref.stderr index f2e0d379d1b..3e36f2402a9 100644 --- a/src/test/ui/auto-ref-slice-plus-ref.stderr +++ b/src/test/ui/auto-ref-slice-plus-ref.stderr @@ -12,7 +12,7 @@ error[E0599]: no method named `test` found for type `std::vec::Vec<{integer}>` i --> $DIR/auto-ref-slice-plus-ref.rs:8:7 | LL | a.test(); - | ^^^^ + | ^^^^ method not found in `std::vec::Vec<{integer}>` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `test`, perhaps you need to implement it: @@ -22,7 +22,7 @@ error[E0599]: no method named `test` found for type `[{integer}; 1]` in the curr --> $DIR/auto-ref-slice-plus-ref.rs:10:11 | LL | ([1]).test(); - | ^^^^ + | ^^^^ method not found in `[{integer}; 1]` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `test`, perhaps you need to implement it: @@ -32,7 +32,7 @@ error[E0599]: no method named `test` found for type `&[{integer}; 1]` in the cur --> $DIR/auto-ref-slice-plus-ref.rs:11:12 | LL | (&[1]).test(); - | ^^^^ + | ^^^^ method not found in `&[{integer}; 1]` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `test`, perhaps you need to implement it: diff --git a/src/test/ui/class-cast-to-trait.stderr b/src/test/ui/class-cast-to-trait.stderr index 39f308cdfd4..4cab52e3e97 100644 --- a/src/test/ui/class-cast-to-trait.stderr +++ b/src/test/ui/class-cast-to-trait.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `eat` found for type `std::boxed::Box` --> $DIR/class-cast-to-trait.rs:53:8 | LL | nyan.eat(); - | ^^^ + | ^^^ method not found in `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/coherence/coherence_inherent.old.stderr b/src/test/ui/coherence/coherence_inherent.old.stderr index fa564459b21..750d2434806 100644 --- a/src/test/ui/coherence/coherence_inherent.old.stderr +++ b/src/test/ui/coherence/coherence_inherent.old.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the c --> $DIR/coherence_inherent.rs:35:11 | LL | s.the_fn(); - | ^^^^^^ + | ^^^^^^ method not found in `&Lib::TheStruct` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/coherence/coherence_inherent.re.stderr b/src/test/ui/coherence/coherence_inherent.re.stderr index fa564459b21..750d2434806 100644 --- a/src/test/ui/coherence/coherence_inherent.re.stderr +++ b/src/test/ui/coherence/coherence_inherent.re.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the c --> $DIR/coherence_inherent.rs:35:11 | LL | s.the_fn(); - | ^^^^^^ + | ^^^^^^ method not found in `&Lib::TheStruct` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/coherence/coherence_inherent_cc.old.stderr b/src/test/ui/coherence/coherence_inherent_cc.old.stderr index 4d93e699031..59166a46094 100644 --- a/src/test/ui/coherence/coherence_inherent_cc.old.stderr +++ b/src/test/ui/coherence/coherence_inherent_cc.old.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_li --> $DIR/coherence_inherent_cc.rs:26:11 | LL | s.the_fn(); - | ^^^^^^ + | ^^^^^^ method not found in `&coherence_inherent_cc_lib::TheStruct` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/coherence/coherence_inherent_cc.re.stderr b/src/test/ui/coherence/coherence_inherent_cc.re.stderr index 4d93e699031..59166a46094 100644 --- a/src/test/ui/coherence/coherence_inherent_cc.re.stderr +++ b/src/test/ui/coherence/coherence_inherent_cc.re.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_li --> $DIR/coherence_inherent_cc.rs:26:11 | LL | s.the_fn(); - | ^^^^^^ + | ^^^^^^ method not found in `&coherence_inherent_cc_lib::TheStruct` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr index 8f3f91651ed..47b090cb886 100644 --- a/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr +++ b/src/test/ui/const-generics/invalid-const-arg-for-type-param.stderr @@ -11,7 +11,7 @@ LL | struct S; | --------- method `f` not found for this ... LL | S.f::<0>(); - | ^ + | ^ method not found in `S` error[E0107]: wrong number of const arguments: expected 0, found 1 --> $DIR/invalid-const-arg-for-type-param.rs:8:9 diff --git a/src/test/ui/copy-a-resource.stderr b/src/test/ui/copy-a-resource.stderr index cceb9e328b6..054bd0914d3 100644 --- a/src/test/ui/copy-a-resource.stderr +++ b/src/test/ui/copy-a-resource.stderr @@ -5,7 +5,7 @@ LL | struct Foo { | ---------- method `clone` not found for this ... LL | let _y = x.clone(); - | ^^^^^ + | ^^^^^ 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 `clone`, perhaps you need to implement it: diff --git a/src/test/ui/derives/derive-assoc-type-not-impl.stderr b/src/test/ui/derives/derive-assoc-type-not-impl.stderr index b9e175e43d1..038de80508a 100644 --- a/src/test/ui/derives/derive-assoc-type-not-impl.stderr +++ b/src/test/ui/derives/derive-assoc-type-not-impl.stderr @@ -5,7 +5,7 @@ LL | struct Bar { | ------------------ method `clone` not found for this ... LL | Bar:: { x: 1 }.clone(); - | ^^^^^ + | ^^^^^ method not found in `Bar` | = note: the method `clone` exists but the following trait bounds were not satisfied: `Bar : std::clone::Clone` diff --git a/src/test/ui/error-festival.stderr b/src/test/ui/error-festival.stderr index 8808e95d81b..73571a375b5 100644 --- a/src/test/ui/error-festival.stderr +++ b/src/test/ui/error-festival.stderr @@ -24,7 +24,7 @@ error[E0599]: no method named `z` found for type `&str` in the current scope --> $DIR/error-festival.rs:16:7 | LL | x.z(); - | ^ + | ^ method not found in `&str` error[E0600]: cannot apply unary operator `!` to type `Question` --> $DIR/error-festival.rs:19:5 diff --git a/src/test/ui/hygiene/no_implicit_prelude.stderr b/src/test/ui/hygiene/no_implicit_prelude.stderr index 643f803f620..8fa55d05bdd 100644 --- a/src/test/ui/hygiene/no_implicit_prelude.stderr +++ b/src/test/ui/hygiene/no_implicit_prelude.stderr @@ -22,7 +22,7 @@ LL | fn f() { ::bar::m!(); } | ------------ in this macro invocation ... LL | ().clone() - | ^^^^^ + | ^^^^^ method not found in `()` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/hygiene/trait_items.stderr b/src/test/ui/hygiene/trait_items.stderr index 4192b97e750..39e32522c7a 100644 --- a/src/test/ui/hygiene/trait_items.stderr +++ b/src/test/ui/hygiene/trait_items.stderr @@ -5,7 +5,7 @@ LL | fn f() { ::baz::m!(); } | ------------ in this macro invocation ... LL | pub macro m() { ().f() } - | ^ + | ^ method not found in `()` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/impl-trait/bindings-opaque.stderr b/src/test/ui/impl-trait/bindings-opaque.stderr index ad108173a7a..644d26b3406 100644 --- a/src/test/ui/impl-trait/bindings-opaque.stderr +++ b/src/test/ui/impl-trait/bindings-opaque.stderr @@ -10,19 +10,19 @@ error[E0599]: no method named `count_ones` found for type `impl std::marker::Cop --> $DIR/bindings-opaque.rs:11:17 | LL | let _ = FOO.count_ones(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ method not found in `impl std::marker::Copy` error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope --> $DIR/bindings-opaque.rs:13:17 | LL | let _ = BAR.count_ones(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ method not found in `impl std::marker::Copy` error[E0599]: no method named `count_ones` found for type `impl std::marker::Copy` in the current scope --> $DIR/bindings-opaque.rs:15:17 | LL | let _ = foo.count_ones(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ method not found in `impl std::marker::Copy` error: aborting due to 3 previous errors diff --git a/src/test/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.stderr b/src/test/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.stderr index 666418f6ee2..441191beaf5 100644 --- a/src/test/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.stderr +++ b/src/test/ui/impl-trait/issues/issue-21659-show-relevant-trait-impls-3.stderr @@ -5,7 +5,7 @@ LL | struct Bar; | ----------- method `foo` not found for this ... LL | f1.foo(1usize); - | ^^^ + | ^^^ 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 `foo`, perhaps you need to implement it: diff --git a/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr b/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr index afb3376638a..fb870d6c6f0 100644 --- a/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr +++ b/src/test/ui/impl-trait/method-suggestion-no-duplication.stderr @@ -5,7 +5,7 @@ LL | struct Foo; | ----------- method `is_empty` not found for this ... LL | foo(|s| s.is_empty()); - | ^^^^^^^^ + | ^^^^^^^^ 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 `is_empty`, perhaps you need to implement it: 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 002b60f9f25..be8f3ab1b72 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr +++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `method` found for type `u32` in the current scope --> $DIR/no-method-suggested-traits.rs:23:10 | LL | 1u32.method(); - | ^^^^^^ + | ^^^^^^ method not found in `u32` | = help: items from traits can only be used if the trait is in scope help: the following traits are implemented but not in scope, perhaps add a `use` for one of them: @@ -20,7 +20,7 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box --> $DIR/no-method-suggested-traits.rs:26:44 | LL | std::rc::Rc::new(&mut Box::new(&1u32)).method(); - | ^^^^^^ + | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u32>>` | = help: items from traits can only be used if the trait is in scope help: the following traits are implemented but not in scope, perhaps add a `use` for one of them: @@ -38,7 +38,7 @@ error[E0599]: no method named `method` found for type `char` in the current scop --> $DIR/no-method-suggested-traits.rs:30:9 | LL | 'a'.method(); - | ^^^^^^ + | ^^^^^^ method not found in `char` | = 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: @@ -58,7 +58,7 @@ LL | fn method(&self) {} | the method is available for `std::rc::Rc>>` here ... LL | std::rc::Rc::new(&mut Box::new(&'a')).method(); - | ^^^^^^ + | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&char>>` | = 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: @@ -70,7 +70,7 @@ error[E0599]: no method named `method` found for type `i32` in the current scope --> $DIR/no-method-suggested-traits.rs:35:10 | LL | 1i32.method(); - | ^^^^^^ + | ^^^^^^ method not found in `i32` | = 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: @@ -82,7 +82,7 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box --> $DIR/no-method-suggested-traits.rs:37:44 | LL | std::rc::Rc::new(&mut Box::new(&1i32)).method(); - | ^^^^^^ + | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&i32>>` | = 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: @@ -97,7 +97,7 @@ LL | struct Foo; | ----------- method `method` not found for this ... 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: @@ -110,7 +110,7 @@ error[E0599]: no method named `method` found for type `std::rc::Rc<&mut std::box --> $DIR/no-method-suggested-traits.rs:42:43 | LL | std::rc::Rc::new(&mut Box::new(&Foo)).method(); - | ^^^^^^ + | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::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: @@ -123,7 +123,7 @@ error[E0599]: no method named `method2` found for type `u64` in the current scop --> $DIR/no-method-suggested-traits.rs:45: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: the following trait defines an item `method2`, perhaps you need to implement it: @@ -133,7 +133,7 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo --> $DIR/no-method-suggested-traits.rs:47:44 | LL | std::rc::Rc::new(&mut Box::new(&1u64)).method2(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u64>>` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `method2`, perhaps you need to implement it: @@ -143,7 +143,7 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai --> $DIR/no-method-suggested-traits.rs:50: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: the following trait defines an item `method2`, perhaps you need to implement it: @@ -153,7 +153,7 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo --> $DIR/no-method-suggested-traits.rs:52:71 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `method2`, perhaps you need to implement it: @@ -163,7 +163,7 @@ error[E0599]: no method named `method2` found for type `no_method_suggested_trai --> $DIR/no-method-suggested-traits.rs:54: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: the following trait defines an item `method2`, perhaps you need to implement it: @@ -173,7 +173,7 @@ error[E0599]: no method named `method2` found for type `std::rc::Rc<&mut std::bo --> $DIR/no-method-suggested-traits.rs:56:74 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `method2`, perhaps you need to implement it: @@ -186,7 +186,7 @@ LL | struct Foo; | ----------- method `method3` not found for this ... 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: @@ -196,7 +196,7 @@ error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::bo --> $DIR/no-method-suggested-traits.rs:61:43 | LL | std::rc::Rc::new(&mut Box::new(&Foo)).method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::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: @@ -209,7 +209,7 @@ LL | enum Bar { X } | -------- method `method3` not found for this ... 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: @@ -219,7 +219,7 @@ error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::bo --> $DIR/no-method-suggested-traits.rs:65:46 | LL | std::rc::Rc::new(&mut Box::new(&Bar::X)).method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::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: @@ -229,37 +229,37 @@ error[E0599]: no method named `method3` found for type `usize` in the current sc --> $DIR/no-method-suggested-traits.rs:69:13 | LL | 1_usize.method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `usize` error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&usize>>` in the current scope --> $DIR/no-method-suggested-traits.rs:70:47 | LL | std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&usize>>` error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Foo` in the current scope --> $DIR/no-method-suggested-traits.rs:71:37 | LL | no_method_suggested_traits::Foo.method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `no_method_suggested_traits::Foo` error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope --> $DIR/no-method-suggested-traits.rs:72:71 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` error[E0599]: no method named `method3` found for type `no_method_suggested_traits::Bar` in the current scope --> $DIR/no-method-suggested-traits.rs:74:40 | LL | no_method_suggested_traits::Bar::X.method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `no_method_suggested_traits::Bar` error[E0599]: no method named `method3` found for type `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope --> $DIR/no-method-suggested-traits.rs:75:74 | LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` error: aborting due to 24 previous errors diff --git a/src/test/ui/infinite/infinite-autoderef.stderr b/src/test/ui/infinite/infinite-autoderef.stderr index 3159a4b67da..a2ad58a7e46 100644 --- a/src/test/ui/infinite/infinite-autoderef.stderr +++ b/src/test/ui/infinite/infinite-autoderef.stderr @@ -44,7 +44,7 @@ LL | struct Foo; | ----------- method `bar` not found for this ... LL | Foo.bar(); - | ^^^ + | ^^^ method not found in `Foo` error: aborting due to 6 previous errors diff --git a/src/test/ui/issues/issue-10465.stderr b/src/test/ui/issues/issue-10465.stderr index 6efbd8e40ef..413daa6db67 100644 --- a/src/test/ui/issues/issue-10465.stderr +++ b/src/test/ui/issues/issue-10465.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `&b::B` in the current scope --> $DIR/issue-10465.rs:17:15 | LL | b.foo(); - | ^^^ + | ^^^ method not found in `&b::B` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/issues/issue-13853.stderr b/src/test/ui/issues/issue-13853.stderr index 9026845b4ed..c57ca3e25d9 100644 --- a/src/test/ui/issues/issue-13853.stderr +++ b/src/test/ui/issues/issue-13853.stderr @@ -14,7 +14,7 @@ error[E0599]: no method named `iter` found for type `&G` in the current scope --> $DIR/issue-13853.rs:27:23 | LL | for node in graph.iter() { - | ^^^^ + | ^^^^ method not found in `&G` error[E0308]: mismatched types --> $DIR/issue-13853.rs:37:13 diff --git a/src/test/ui/issues/issue-15207.stderr b/src/test/ui/issues/issue-15207.stderr index 2d90eb80fc5..25ce7cb5cc0 100644 --- a/src/test/ui/issues/issue-15207.stderr +++ b/src/test/ui/issues/issue-15207.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `push` found for type `!` in the current scope --> $DIR/issue-15207.rs:3:15 | LL | break.push(1) - | ^^^^ + | ^^^^ method not found in `!` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-1871.stderr b/src/test/ui/issues/issue-1871.stderr index fecd689251b..b774ca22dd7 100644 --- a/src/test/ui/issues/issue-1871.stderr +++ b/src/test/ui/issues/issue-1871.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `honk` found for type `{integer}` in the current s --> $DIR/issue-1871.rs:7:9 | LL | f.honk() - | ^^^^ + | ^^^^ method not found in `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19521.stderr b/src/test/ui/issues/issue-19521.stderr index a43368be583..c15c5392fac 100644 --- a/src/test/ui/issues/issue-19521.stderr +++ b/src/test/ui/issues/issue-19521.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for type `&'static str` in the curr --> $DIR/issue-19521.rs:2:8 | LL | "".homura()(); - | ^^^^^^ + | ^^^^^^ method not found in `&'static str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19692.stderr b/src/test/ui/issues/issue-19692.stderr index 5e576f11583..fe920c16939 100644 --- a/src/test/ui/issues/issue-19692.stderr +++ b/src/test/ui/issues/issue-19692.stderr @@ -5,7 +5,7 @@ LL | struct Homura; | -------------- method `kaname` not found for this ... LL | let Some(ref madoka) = Some(homura.kaname()); - | ^^^^^^ + | ^^^^^^ method not found in `Homura` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-2149.stderr b/src/test/ui/issues/issue-2149.stderr index 1df32aafa79..8ce2ba03332 100644 --- a/src/test/ui/issues/issue-2149.stderr +++ b/src/test/ui/issues/issue-2149.stderr @@ -10,7 +10,7 @@ error[E0599]: no method named `bind` found for type `[&str; 1]` in the current s --> $DIR/issue-2149.rs:13:12 | LL | ["hi"].bind(|x| [x] ); - | ^^^^ + | ^^^^ method not found in `[&str; 1]` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `bind`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-21596.stderr b/src/test/ui/issues/issue-21596.stderr index 8e4e09b13a9..4e5cace5257 100644 --- a/src/test/ui/issues/issue-21596.stderr +++ b/src/test/ui/issues/issue-21596.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `to_string` found for type `*const u8` in the curr --> $DIR/issue-21596.rs:4:22 | LL | println!("{}", z.to_string()); - | ^^^^^^^^^ + | ^^^^^^^^^ method not found in `*const u8` | = note: try using `<*const T>::as_ref()` to get a reference to the type behind the pointer: https://doc.rust-lang.org/std/primitive.pointer.html#method.as_ref = note: using `<*const T>::as_ref()` on a pointer which is unaligned or points to invalid or uninitialized memory is undefined behavior diff --git a/src/test/ui/issues/issue-25385.stderr b/src/test/ui/issues/issue-25385.stderr index e170a9d383b..ab4db7e42a4 100644 --- a/src/test/ui/issues/issue-25385.stderr +++ b/src/test/ui/issues/issue-25385.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `i32` in the current scope --> $DIR/issue-25385.rs:2:23 | LL | ($e:expr) => { $e.foo() } - | ^^^ + | ^^^ method not found in `i32` ... LL | foo!(a); | -------- in this macro invocation @@ -11,7 +11,7 @@ error[E0599]: no method named `foo` found for type `i32` in the current scope --> $DIR/issue-25385.rs:10:15 | LL | foo!(1i32.foo()); - | ^^^ + | ^^^ method not found in `i32` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-2823.stderr b/src/test/ui/issues/issue-2823.stderr index 4c1dfb8501a..c9ede030034 100644 --- a/src/test/ui/issues/issue-2823.stderr +++ b/src/test/ui/issues/issue-2823.stderr @@ -5,7 +5,7 @@ LL | struct C { | -------- method `clone` not found for this ... LL | let _d = c.clone(); - | ^^^^^ + | ^^^^^ method not found in `C` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-29124.stderr b/src/test/ui/issues/issue-29124.stderr index 3beb7289788..c537c6118f3 100644 --- a/src/test/ui/issues/issue-29124.stderr +++ b/src/test/ui/issues/issue-29124.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `x` found for type `fn() -> Ret {Obj::func}` in th --> $DIR/issue-29124.rs:15:15 | LL | Obj::func.x(); - | ^ + | ^ method not found in `fn() -> Ret {Obj::func}` | = note: Obj::func is a function, perhaps you wish to call it @@ -10,7 +10,7 @@ error[E0599]: no method named `x` found for type `fn() -> Ret {func}` in the cur --> $DIR/issue-29124.rs:17:10 | LL | func.x(); - | ^ + | ^ method not found in `fn() -> Ret {func}` | = note: func is a function, perhaps you wish to call it diff --git a/src/test/ui/issues/issue-29181.stderr b/src/test/ui/issues/issue-29181.stderr index 09201428154..250b158ab8e 100644 --- a/src/test/ui/issues/issue-29181.stderr +++ b/src/test/ui/issues/issue-29181.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for type `{integer}` in the current --> $DIR/issue-29181.rs:6:7 | LL | 0.homura(); - | ^^^^^^ + | ^^^^^^ method not found in `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 3ca83388826..6d03b781093 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -11,7 +11,7 @@ error[E0599]: no method named `collect` found for type `std::iter::Cloned $DIR/issue-31173.rs:14:10 | LL | .collect(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::iter::Cloned, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>>` | = note: the method `collect` exists but the following trait bounds were not satisfied: `&mut std::iter::Cloned, [closure@$DIR/issue-31173.rs:6:39: 9:6 found_e:_]>> : std::iter::Iterator` diff --git a/src/test/ui/issues/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr index 7f89caf92ab..8d52e08374a 100644 --- a/src/test/ui/issues/issue-34334.stderr +++ b/src/test/ui/issues/issue-34334.stderr @@ -45,7 +45,7 @@ error[E0599]: no method named `iter` found for type `()` in the current scope --> $DIR/issue-34334.rs:9:36 | LL | let sr2: Vec<(u32, _, _)> = sr.iter().map(|(faction, th_sender, th_receiver)| {}).collect(); - | ^^^^ + | ^^^^ method not found in `()` error: aborting due to 7 previous errors diff --git a/src/test/ui/issues/issue-35677.stderr b/src/test/ui/issues/issue-35677.stderr index 99d99db93f3..b381203856e 100644 --- a/src/test/ui/issues/issue-35677.stderr +++ b/src/test/ui/issues/issue-35677.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `is_subset` found for type `&std::collections::Has --> $DIR/issue-35677.rs:4:10 | LL | this.is_subset(other) - | ^^^^^^^^^ + | ^^^^^^^^^ method not found in `&std::collections::HashSet` | = note: the method `is_subset` exists but the following trait bounds were not satisfied: `T : std::cmp::Eq` diff --git a/src/test/ui/issues/issue-39175.stderr b/src/test/ui/issues/issue-39175.stderr index 108c969cdad..66680b9936e 100644 --- a/src/test/ui/issues/issue-39175.stderr +++ b/src/test/ui/issues/issue-39175.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `exec` found for type `&mut std::process::Command` --> $DIR/issue-39175.rs:15:39 | LL | Command::new("echo").arg("hello").exec(); - | ^^^^ + | ^^^^ method not found in `&mut std::process::Command` | = 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/issues/issue-41880.stderr b/src/test/ui/issues/issue-41880.stderr index 359a2340240..0e1d55c339e 100644 --- a/src/test/ui/issues/issue-41880.stderr +++ b/src/test/ui/issues/issue-41880.stderr @@ -5,7 +5,7 @@ LL | pub struct Iterate { | ------------------------ method `iter` not found for this ... LL | println!("{:?}", a.iter().take(10).collect::>()); - | ^^^^ + | ^^^^ method not found in `Iterate<{integer}, [closure@$DIR/issue-41880.rs:26:24: 26:31]>` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-43189.stderr b/src/test/ui/issues/issue-43189.stderr index e364650da40..33c3f18650a 100644 --- a/src/test/ui/issues/issue-43189.stderr +++ b/src/test/ui/issues/issue-43189.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `a` found for type `()` in the current scope --> $DIR/issue-43189.rs:10:8 | LL | ().a(); - | ^ + | ^ method not found in `()` | = 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/issues/issue-50264-inner-deref-trait/option-as_deref_mut.stderr b/src/test/ui/issues/issue-50264-inner-deref-trait/option-as_deref_mut.stderr index 2c3a18be67c..29fd15fb396 100644 --- a/src/test/ui/issues/issue-50264-inner-deref-trait/option-as_deref_mut.stderr +++ b/src/test/ui/issues/issue-50264-inner-deref-trait/option-as_deref_mut.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `as_deref_mut` found for type `std::option::Option --> $DIR/option-as_deref_mut.rs:4:33 | LL | let _result = &mut Some(42).as_deref_mut(); - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ method not found in `std::option::Option<{integer}>` | = note: the method `as_deref_mut` exists but the following trait bounds were not satisfied: `{integer} : std::ops::DerefMut` diff --git a/src/test/ui/issues/issue-5153.stderr b/src/test/ui/issues/issue-5153.stderr index 97214fbdc52..5034e6d538e 100644 --- a/src/test/ui/issues/issue-5153.stderr +++ b/src/test/ui/issues/issue-5153.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `&dyn Foo` in the current sco --> $DIR/issue-5153.rs:10:27 | LL | (&5isize as &dyn Foo).foo(); - | ^^^ + | ^^^ method not found in `&dyn Foo` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `foo`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-54062.stderr b/src/test/ui/issues/issue-54062.stderr index 082ac91edb1..3830ad4b1e3 100644 --- a/src/test/ui/issues/issue-54062.stderr +++ b/src/test/ui/issues/issue-54062.stderr @@ -8,7 +8,7 @@ error[E0599]: no method named `unwrap` found for type `std::sys_common::mutex::M --> $DIR/issue-54062.rs:10:37 | LL | let _ = test.comps.inner.lock().unwrap(); - | ^^^^^^ + | ^^^^^^ method not found in `std::sys_common::mutex::MutexGuard<'_>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-57362-1.stderr b/src/test/ui/issues/issue-57362-1.stderr index 1d2ff7669c0..c4000c8a9d4 100644 --- a/src/test/ui/issues/issue-57362-1.stderr +++ b/src/test/ui/issues/issue-57362-1.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `f` found for type `fn(&u8)` in the current scope --> $DIR/issue-57362-1.rs:20:7 | LL | a.f(); - | ^ + | ^ method not found in `fn(&u8)` | = note: a is a function, perhaps you wish to call it = help: items from traits can only be used if the trait is implemented and in scope diff --git a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr index 015e05ed9bf..96054de801c 100644 --- a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr +++ b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s --> $DIR/macro-backtrace-invalid-internals.rs:5:13 | LL | 1.fake() - | ^^^^ + | ^^^^ method not found in `{integer}` ... LL | fake_method_stmt!(); | -------------------- in this macro invocation @@ -42,7 +42,7 @@ error[E0599]: no method named `fake` found for type `{integer}` in the current s --> $DIR/macro-backtrace-invalid-internals.rs:23:13 | LL | 1.fake() - | ^^^^ + | ^^^^ method not found in `{integer}` ... LL | let _ = fake_method_expr!(); | ------------------- in this macro invocation diff --git a/src/test/ui/methods/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr index b8ae4c34dc1..94c27b7d178 100644 --- a/src/test/ui/methods/method-call-err-msg.stderr +++ b/src/test/ui/methods/method-call-err-msg.stderr @@ -32,7 +32,7 @@ LL | pub struct Foo; | --------------- method `take` not found for this ... LL | .take() - | ^^^^ + | ^^^^ method not found in `Foo` | = note: the method `take` exists but the following trait bounds were not satisfied: `&mut Foo : std::iter::Iterator` diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index 3f87ef74b8e..89c7b098115 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `count` found for type `std::iter::Filter $DIR/issue-36053-2.rs:7:55 | LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); - | ^^^^^ + | ^^^^^ method not found in `std::iter::Filter>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]>` | = note: the method `count` exists but the following trait bounds were not satisfied: `&mut std::iter::Filter>, [closure@$DIR/issue-36053-2.rs:7:39: 7:53]> : std::iter::Iterator` diff --git a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr index 9721dc8ba4e..865092e4e9c 100644 --- a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr +++ b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `unwrap` found for type `std::result::Result<(), F --> $DIR/method-help-unsatisfied-bound.rs:5:7 | LL | a.unwrap(); - | ^^^^^^ + | ^^^^^^ method not found in `std::result::Result<(), Foo>` | = note: the method `unwrap` exists but the following trait bounds were not satisfied: `Foo : std::fmt::Debug` diff --git a/src/test/ui/non-copyable-void.stderr b/src/test/ui/non-copyable-void.stderr index 4041e1935dc..b05c29c0d40 100644 --- a/src/test/ui/non-copyable-void.stderr +++ b/src/test/ui/non-copyable-void.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `clone` found for type `libc::c_void` in the curre --> $DIR/non-copyable-void.rs:11:23 | LL | let _z = (*y).clone(); - | ^^^^^ + | ^^^^^ method not found in `libc::c_void` error: aborting due to previous error diff --git a/src/test/ui/noncopyable-class.stderr b/src/test/ui/noncopyable-class.stderr index eb47a33a729..c1c50211381 100644 --- a/src/test/ui/noncopyable-class.stderr +++ b/src/test/ui/noncopyable-class.stderr @@ -5,7 +5,7 @@ LL | struct Foo { | ---------- method `clone` not found for this ... LL | let _y = x.clone(); - | ^^^^^ + | ^^^^^ 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 `clone`, perhaps you need to implement it: diff --git a/src/test/ui/object-pointer-types.stderr b/src/test/ui/object-pointer-types.stderr index 0c7e4e991a5..2df628ecf8e 100644 --- a/src/test/ui/object-pointer-types.stderr +++ b/src/test/ui/object-pointer-types.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `owned` found for type `&dyn Foo` in the current s --> $DIR/object-pointer-types.rs:11:7 | LL | x.owned(); - | ^^^^^ + | ^^^^^ method not found in `&dyn Foo` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `owned`, perhaps you need to implement it: @@ -12,7 +12,7 @@ error[E0599]: no method named `owned` found for type `&mut dyn Foo` in the curre --> $DIR/object-pointer-types.rs:17:7 | LL | x.owned(); - | ^^^^^ + | ^^^^^ method not found in `&mut dyn Foo` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `owned`, perhaps you need to implement it: @@ -22,7 +22,7 @@ error[E0599]: no method named `managed` found for type `std::boxed::Box<(dyn Foo --> $DIR/object-pointer-types.rs:23:7 | LL | x.managed(); - | ^^^^^^^ + | ^^^^^^^ method not found in `std::boxed::Box<(dyn Foo + 'static)>` error: aborting due to 3 previous errors diff --git a/src/test/ui/rust-2018/trait-import-suggestions.stderr b/src/test/ui/rust-2018/trait-import-suggestions.stderr index a81181228df..19f758fd8da 100644 --- a/src/test/ui/rust-2018/trait-import-suggestions.stderr +++ b/src/test/ui/rust-2018/trait-import-suggestions.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `foobar` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:22:11 | LL | x.foobar(); - | ^^^^^^ + | ^^^^^^ method not found in `u32` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: @@ -12,7 +12,7 @@ error[E0599]: no method named `bar` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:28:7 | LL | x.bar(); - | ^^^ + | ^^^ method not found in `u32` | = 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: @@ -24,7 +24,7 @@ error[E0599]: no method named `baz` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:29:7 | LL | x.baz(); - | ^^^ + | ^^^ method not found in `u32` error[E0599]: no function or associated item named `from_str` found for type `u32` in the current scope --> $DIR/trait-import-suggestions.rs:30:18 diff --git a/src/test/ui/self/point-at-arbitrary-self-type-method.stderr b/src/test/ui/self/point-at-arbitrary-self-type-method.stderr index 06dad7caa67..dec5809f153 100644 --- a/src/test/ui/self/point-at-arbitrary-self-type-method.stderr +++ b/src/test/ui/self/point-at-arbitrary-self-type-method.stderr @@ -8,7 +8,7 @@ LL | fn foo(self: Box) {} | --- the method is available for `std::boxed::Box` here ... LL | A.foo(); - | ^^^ + | ^^^ method not found in `A` error: aborting due to previous error diff --git a/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr b/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr index 90cd3b80745..e93c4da9dfc 100644 --- a/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr +++ b/src/test/ui/self/point-at-arbitrary-self-type-trait-method.stderr @@ -7,7 +7,7 @@ LL | struct A; | --------- method `foo` not found for this ... LL | A.foo() - | ^^^ + | ^^^ method not found in `A` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `foo`, perhaps you need to implement it: diff --git a/src/test/ui/shadowed/shadowed-trait-methods.stderr b/src/test/ui/shadowed/shadowed-trait-methods.stderr index e05da17983f..190159ec7b8 100644 --- a/src/test/ui/shadowed/shadowed-trait-methods.stderr +++ b/src/test/ui/shadowed/shadowed-trait-methods.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `f` found for type `()` in the current scope --> $DIR/shadowed-trait-methods.rs:13:8 | LL | ().f() - | ^ + | ^ method not found in `()` | = 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/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr index c14fc04f631..bbfe4c3d59d 100644 --- a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr +++ b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr @@ -5,7 +5,7 @@ LL | struct MyStruct; | ---------------- method `foo_one` not found for this ... LL | println!("{}", MyStruct.foo_one()); - | ^^^^^^^ + | ^^^^^^^ method not found in `MyStruct` | = note: the method `foo_one` exists but the following trait bounds were not satisfied: `MyStruct : Foo` diff --git a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr b/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr index 48c2503e8eb..4aec72006ee 100644 --- a/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr +++ b/src/test/ui/suggestions/impl-trait-with-missing-trait-bounds-in-arg.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `hello` found for type `impl Foo` in the current s --> $DIR/impl-trait-with-missing-trait-bounds-in-arg.rs:15:9 | LL | foo.hello(); - | ^^^^^ + | ^^^^^ method not found in `impl 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 `hello`, perhaps you need to restrict type parameter `impl Foo` with it: diff --git a/src/test/ui/suggestions/issue-21673.stderr b/src/test/ui/suggestions/issue-21673.stderr index 6cf71c8b7c5..f2496f696d6 100644 --- a/src/test/ui/suggestions/issue-21673.stderr +++ b/src/test/ui/suggestions/issue-21673.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `method` found for type `&T` in the current scope --> $DIR/issue-21673.rs:6:7 | LL | x.method() - | ^^^^^^ + | ^^^^^^ method not found in `&T` | = help: items from traits can only be used if the type parameter is bounded by the trait help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it: @@ -14,7 +14,7 @@ error[E0599]: no method named `method` found for type `T` in the current scope --> $DIR/issue-21673.rs:10:7 | LL | x.method() - | ^^^^^^ + | ^^^^^^ method not found in `T` | = help: items from traits can only be used if the type parameter is bounded by the trait help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it: diff --git a/src/test/ui/suggestions/suggest-methods.stderr b/src/test/ui/suggestions/suggest-methods.stderr index ad4a4deb5a8..4678410eb48 100644 --- a/src/test/ui/suggestions/suggest-methods.stderr +++ b/src/test/ui/suggestions/suggest-methods.stderr @@ -23,7 +23,7 @@ error[E0599]: no method named `count_o` found for type `u32` in the current scop --> $DIR/suggest-methods.rs:28:19 | LL | let _ = 63u32.count_o(); - | ^^^^^^^ + | ^^^^^^^ method not found in `u32` error: aborting due to 4 previous errors diff --git a/src/test/ui/traits/trait-impl-1.stderr b/src/test/ui/traits/trait-impl-1.stderr index 71d5cc26bf1..0d61c3ed00d 100644 --- a/src/test/ui/traits/trait-impl-1.stderr +++ b/src/test/ui/traits/trait-impl-1.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `foo` found for type `&i32` in the current scope --> $DIR/trait-impl-1.rs:15:7 | LL | x.foo(); - | ^^^ + | ^^^ method not found in `&i32` error: aborting due to previous error diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/trait-item-privacy.stderr index 16ea7bdb080..39cc66d275c 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/trait-item-privacy.stderr @@ -5,7 +5,7 @@ LL | struct S; | --------- method `a` not found for this ... LL | S.a(); - | ^ + | ^ method not found in `S` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `a`, perhaps you need to implement it: @@ -25,7 +25,7 @@ LL | fn b(&self) { } | the method is available for `std::rc::Rc` here ... LL | S.b(); - | ^ + | ^ method not found in `S` | = 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/trivial-bounds/trivial-bounds-leak.stderr b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr index f0f048159ec..d172d5ecc4b 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr @@ -12,7 +12,7 @@ error[E0599]: no method named `test` found for type `i32` in the current scope --> $DIR/trivial-bounds-leak.rs:24:10 | LL | 3i32.test(); - | ^^^^ + | ^^^^ method not found in `i32` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `test`, perhaps you need to implement it: diff --git a/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr index 2e1845888a2..18276d5710c 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `call` found for type `[closure@$DIR/unboxed-closu --> $DIR/unboxed-closures-static-call-wrong-trait.rs:7:10 | LL | mut_.call((0, )); - | ^^^^ + | ^^^^ method not found in `[closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:31]` | = note: mut_ is a function, perhaps you wish to call it diff --git a/src/test/ui/underscore-imports/shadow.stderr b/src/test/ui/underscore-imports/shadow.stderr index 92adca2c704..63262d0dc32 100644 --- a/src/test/ui/underscore-imports/shadow.stderr +++ b/src/test/ui/underscore-imports/shadow.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `deref` found for type `&()` in the current scope --> $DIR/shadow.rs:19:11 | LL | x.deref(); - | ^^^^^ + | ^^^^^ method not found in `&()` | = help: items from traits can only be used if the trait is in scope = note: the following trait is implemented but not in scope, perhaps add a `use` for it: diff --git a/src/test/ui/union/union-derive-clone.stderr b/src/test/ui/union/union-derive-clone.stderr index 37a00937840..4f4c779b12b 100644 --- a/src/test/ui/union/union-derive-clone.stderr +++ b/src/test/ui/union/union-derive-clone.stderr @@ -13,7 +13,7 @@ LL | union U4 { | ----------- method `clone` not found for this ... LL | let w = u.clone(); - | ^^^^^ + | ^^^^^ method not found in `U4` | = note: the method `clone` exists but the following trait bounds were not satisfied: `U4 : std::clone::Clone` diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index 407905f52e7..cd46878c19b 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `clone` found for type `std::boxed::Box` --> $DIR/unique-object-noncopyable.rs:24:16 | LL | let _z = y.clone(); - | ^^^^^ + | ^^^^^ method not found in `std::boxed::Box` | = note: the method `clone` exists but the following trait bounds were not satisfied: `std::boxed::Box : std::clone::Clone` diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index 0f6ba90afac..19ef2b21c26 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `clone` found for type `std::boxed::Box` in the --> $DIR/unique-pinned-nocopy.rs:12:16 | LL | let _j = i.clone(); - | ^^^^^ + | ^^^^^ method not found in `std::boxed::Box` | = note: the method `clone` exists but the following trait bounds were not satisfied: `std::boxed::Box : std::clone::Clone` -- 2.44.0