diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index f872caa146f..cdb492b0979 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -69,13 +69,17 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { error: MethodError<'tcx>, args: Option<&'gcx [hir::Expr]>, ) { + let mut span = span; // Avoid suggestions when we don't know what's going on. if rcvr_ty.references_error() { return; } - let report_candidates = |err: &mut DiagnosticBuilder<'_>, - mut sources: Vec| { + let report_candidates = | + span: Span, + err: &mut DiagnosticBuilder<'_>, + mut sources: Vec, + | { sources.sort(); sources.dedup(); // Dynamic limit to avoid hiding just one candidate, which is silly. @@ -293,9 +297,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { err.emit(); return; } else { + span = item_name.span; let mut err = struct_span_err!( tcx.sess, - item_name.span, + span, E0599, "no {} named `{}` found for type `{}` in the current scope", item_kind, @@ -305,7 +310,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { if let Some(suggestion) = suggestion { // enum variant err.span_suggestion( - item_name.span, + span, "did you mean", suggestion.to_string(), Applicability::MaybeIncorrect, @@ -434,9 +439,9 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { self.ty_to_string(actual), item_name)); } - report_candidates(&mut err, static_sources); + report_candidates(span, &mut err, static_sources); } else if static_sources.len() > 1 { - report_candidates(&mut err, static_sources); + report_candidates(span, &mut err, static_sources); } if !unsatisfied_predicates.is_empty() { @@ -481,7 +486,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { "multiple applicable items in scope"); err.span_label(span, format!("multiple `{}` found", item_name)); - report_candidates(&mut err, sources); + report_candidates(span, &mut err, sources); err.emit(); } diff --git a/src/test/ui/associated-const/associated-const-no-item.stderr b/src/test/ui/associated-const/associated-const-no-item.stderr index de172049872..d96cf67b875 100644 --- a/src/test/ui/associated-const/associated-const-no-item.stderr +++ b/src/test/ui/associated-const/associated-const-no-item.stderr @@ -2,9 +2,7 @@ error[E0599]: no associated item named `ID` found for type `i32` in the current --> $DIR/associated-const-no-item.rs:5:23 | LL | const X: i32 = ::ID; - | -------^^ - | | - | associated item not found in `i32` + | ^^ associated item 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 `ID`, perhaps you need to implement it: diff --git a/src/test/ui/bogus-tag.stderr b/src/test/ui/bogus-tag.stderr index 3750df84172..0bf0d4b14ee 100644 --- a/src/test/ui/bogus-tag.stderr +++ b/src/test/ui/bogus-tag.stderr @@ -5,7 +5,7 @@ LL | enum Color { Rgb(isize, isize, isize), Rgba(isize, isize, isize, isize), } | ---------- variant `Hsl` not found here ... LL | Color::Hsl(h, s, l) => { println!("hsl"); } - | -------^^^--------- variant not found in `Color` + | ^^^ variant not found in `Color` error: aborting due to previous error diff --git a/src/test/ui/did_you_mean/bad-assoc-pat.stderr b/src/test/ui/did_you_mean/bad-assoc-pat.stderr index e620e7b4356..51c039760a4 100644 --- a/src/test/ui/did_you_mean/bad-assoc-pat.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-pat.stderr @@ -41,33 +41,25 @@ error[E0599]: no associated item named `AssocItem` found for type `[u8]` in the --> $DIR/bad-assoc-pat.rs:3:15 | LL | [u8]::AssocItem => {} - | ------^^^^^^^^^ - | | - | associated item not found in `[u8]` + | ^^^^^^^^^ associated item not found in `[u8]` error[E0599]: no associated item named `AssocItem` found for type `(u8, u8)` in the current scope --> $DIR/bad-assoc-pat.rs:6:19 | LL | (u8, u8)::AssocItem => {} - | ----------^^^^^^^^^ - | | - | associated item not found in `(u8, u8)` + | ^^^^^^^^^ associated item not found in `(u8, u8)` error[E0599]: no associated item named `AssocItem` found for type `_` in the current scope --> $DIR/bad-assoc-pat.rs:9:12 | LL | _::AssocItem => {} - | ---^^^^^^^^^ - | | - | associated item not found in `_` + | ^^^^^^^^^ associated item not found in `_` error[E0599]: no associated item named `AssocItem` found for type `(u8,)` in the current scope --> $DIR/bad-assoc-pat.rs:14:17 | LL | &(u8,)::AssocItem => {} - | -------^^^^^^^^^ - | | - | associated item not found in `(u8,)` + | ^^^^^^^^^ associated item not found in `(u8,)` error[E0599]: no associated item named `AssocItem` found for type `u8` in the current scope --> $DIR/bad-assoc-pat.rs:21:24 diff --git a/src/test/ui/dont-suggest-private-trait-method.stderr b/src/test/ui/dont-suggest-private-trait-method.stderr index af4253779a4..5189ffa62d1 100644 --- a/src/test/ui/dont-suggest-private-trait-method.stderr +++ b/src/test/ui/dont-suggest-private-trait-method.stderr @@ -5,9 +5,7 @@ LL | struct T; | --------- function or associated item `new` not found for this ... LL | T::new(); - | ---^^^ - | | - | function or associated item not found in `T` + | ^^^ function or associated item not found in `T` error: aborting due to previous error diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr index a20d7998249..57c8c1c85dd 100644 --- a/src/test/ui/empty/empty-struct-braces-expr.stderr +++ b/src/test/ui/empty/empty-struct-braces-expr.stderr @@ -50,19 +50,19 @@ error[E0599]: no variant named `Empty3` found for type `empty_struct::XE` in the --> $DIR/empty-struct-braces-expr.rs:22:19 | LL | let xe3 = XE::Empty3; - | ----^^^^^^ - | | | - | | help: did you mean: `XEmpty3` - | variant not found in `empty_struct::XE` + | ^^^^^^ + | | + | variant not found in `empty_struct::XE` + | help: did you mean: `XEmpty3` error[E0599]: no variant named `Empty3` found for type `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:23:19 | LL | let xe3 = XE::Empty3(); - | ----^^^^^^ - | | | - | | help: did you mean: `XEmpty3` - | variant not found in `empty_struct::XE` + | ^^^^^^ + | | + | variant not found in `empty_struct::XE` + | help: did you mean: `XEmpty3` error: aborting due to 8 previous errors diff --git a/src/test/ui/error-codes/E0599.stderr b/src/test/ui/error-codes/E0599.stderr index 6fb53e72763..89bfccf2fbc 100644 --- a/src/test/ui/error-codes/E0599.stderr +++ b/src/test/ui/error-codes/E0599.stderr @@ -5,7 +5,7 @@ LL | struct Foo; | ----------- associated item `NotEvenReal` not found for this ... LL | || if let Foo::NotEvenReal() = Foo {}; - | -----^^^^^^^^^^^-- associated item not found in `Foo` + | ^^^^^^^^^^^ associated item not found in `Foo` error: aborting due to previous error diff --git a/src/test/ui/invalid/invalid-path-in-const.stderr b/src/test/ui/invalid/invalid-path-in-const.stderr index 13176b8b8fb..a14ab7d85e8 100644 --- a/src/test/ui/invalid/invalid-path-in-const.stderr +++ b/src/test/ui/invalid/invalid-path-in-const.stderr @@ -2,9 +2,7 @@ error[E0599]: no associated item named `DOESNOTEXIST` found for type `u32` in th --> $DIR/invalid-path-in-const.rs:2:23 | LL | fn f(a: [u8; u32::DOESNOTEXIST]) {} - | -----^^^^^^^^^^^^ - | | - | associated item not found in `u32` + | ^^^^^^^^^^^^ associated item not found in `u32` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-22933-2.stderr b/src/test/ui/issues/issue-22933-2.stderr index 97962adc2d2..23b1474bde7 100644 --- a/src/test/ui/issues/issue-22933-2.stderr +++ b/src/test/ui/issues/issue-22933-2.stderr @@ -5,9 +5,7 @@ LL | enum Delicious { | -------------- variant `PIE` not found here ... LL | ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, - | -----------^^^ - | | - | variant not found in `Delicious` + | ^^^ variant not found in `Delicious` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-22933-3.stderr b/src/test/ui/issues/issue-22933-3.stderr index aa0052f9701..b1afda6d151 100644 --- a/src/test/ui/issues/issue-22933-3.stderr +++ b/src/test/ui/issues/issue-22933-3.stderr @@ -2,9 +2,7 @@ error[E0599]: no associated item named `MIN` found for type `u8` in the current --> $DIR/issue-22933-3.rs:1:22 | LL | const FOO: [u32; u8::MIN as usize] = []; - | ----^^^ - | | - | associated item not found in `u8` + | ^^^ associated item not found in `u8` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23173.stderr b/src/test/ui/issues/issue-23173.stderr index 98c4f867ad6..75dba883608 100644 --- a/src/test/ui/issues/issue-23173.stderr +++ b/src/test/ui/issues/issue-23173.stderr @@ -5,9 +5,7 @@ LL | enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ } | ---------- variant `Homura` not found here ... LL | use_token(&Token::Homura); - | -------^^^^^^ - | | - | variant not found in `Token` + | ^^^^^^ variant not found in `Token` error[E0599]: no function or associated item named `method` found for type `Struct` in the current scope --> $DIR/issue-23173.rs:11:13 @@ -16,9 +14,7 @@ LL | struct Struct { | ------------- function or associated item `method` not found for this ... LL | Struct::method(); - | --------^^^^^^ - | | - | function or associated item not found in `Struct` + | ^^^^^^ function or associated item not found in `Struct` error[E0599]: no function or associated item named `method` found for type `Struct` in the current scope --> $DIR/issue-23173.rs:13:13 @@ -27,9 +23,7 @@ LL | struct Struct { | ------------- function or associated item `method` not found for this ... LL | Struct::method; - | --------^^^^^^ - | | - | function or associated item not found in `Struct` + | ^^^^^^ function or associated item not found in `Struct` error[E0599]: no associated item named `Assoc` found for type `Struct` in the current scope --> $DIR/issue-23173.rs:15:13 @@ -38,9 +32,7 @@ LL | struct Struct { | ------------- associated item `Assoc` not found for this ... LL | Struct::Assoc; - | --------^^^^^ - | | - | associated item not found in `Struct` + | ^^^^^ associated item not found in `Struct` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-23217.stderr b/src/test/ui/issues/issue-23217.stderr index 9cad002036f..2a982422cab 100644 --- a/src/test/ui/issues/issue-23217.stderr +++ b/src/test/ui/issues/issue-23217.stderr @@ -4,10 +4,10 @@ error[E0599]: no variant named `A` found for type `SomeEnum` in the current scop LL | pub enum SomeEnum { | ----------------- variant `A` not found here LL | B = SomeEnum::A, - | ----------^ - | | | - | | help: did you mean: `B` - | variant not found in `SomeEnum` + | ^ + | | + | variant not found in `SomeEnum` + | help: did you mean: `B` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr index b6f520c644b..fcd98b111cf 100644 --- a/src/test/ui/issues/issue-28344.stderr +++ b/src/test/ui/issues/issue-28344.stderr @@ -8,10 +8,10 @@ error[E0599]: no function or associated item named `bitor` found for type `dyn s --> $DIR/issue-28344.rs:4:25 | LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); - | --------^^^^^ - | | - | function or associated item not found in `dyn std::ops::BitXor<_>` - | help: did you mean: `bitxor` + | ^^^^^ + | | + | function or associated item not found in `dyn std::ops::BitXor<_>` + | help: did you mean: `bitxor` error[E0191]: the value of the associated type `Output` (from the trait `std::ops::BitXor`) must be specified --> $DIR/issue-28344.rs:8:13 @@ -23,10 +23,10 @@ error[E0599]: no function or associated item named `bitor` found for type `dyn s --> $DIR/issue-28344.rs:8:21 | LL | let g = BitXor::bitor; - | --------^^^^^ - | | - | function or associated item not found in `dyn std::ops::BitXor<_>` - | help: did you mean: `bitxor` + | ^^^^^ + | | + | function or associated item not found in `dyn std::ops::BitXor<_>` + | help: did you mean: `bitxor` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-28586.stderr b/src/test/ui/issues/issue-28586.stderr index eccb474c15e..d19c4af2df7 100644 --- a/src/test/ui/issues/issue-28586.stderr +++ b/src/test/ui/issues/issue-28586.stderr @@ -2,9 +2,7 @@ error[E0599]: no associated item named `BYTES` found for type `usize` in the cur --> $DIR/issue-28586.rs:4:26 | LL | impl Foo for [u8; usize::BYTES] {} - | -------^^^^^ - | | - | associated item not found in `usize` + | ^^^^^ associated item not found in `usize` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-28971.stderr b/src/test/ui/issues/issue-28971.stderr index 77d0b53ad21..4781f7abe81 100644 --- a/src/test/ui/issues/issue-28971.stderr +++ b/src/test/ui/issues/issue-28971.stderr @@ -5,10 +5,10 @@ LL | enum Foo { | -------- variant `Baz` not found here ... LL | Foo::Baz(..) => (), - | -----^^^---- - | | | - | | help: did you mean: `Bar` - | variant not found in `Foo` + | ^^^ + | | + | variant not found in `Foo` + | help: did you mean: `Bar` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-30123.stderr b/src/test/ui/issues/issue-30123.stderr index 555bdb1236f..32bbd4d03d6 100644 --- a/src/test/ui/issues/issue-30123.stderr +++ b/src/test/ui/issues/issue-30123.stderr @@ -2,9 +2,7 @@ error[E0599]: no function or associated item named `new_undirected` found for ty --> $DIR/issue-30123.rs:7:33 | LL | let ug = Graph::::new_undirected(); - | -------------------^^^^^^^^^^^^^^ - | | - | function or associated item not found in `issue_30123_aux::Graph` + | ^^^^^^^^^^^^^^ function or associated item not found in `issue_30123_aux::Graph` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-38919.stderr b/src/test/ui/issues/issue-38919.stderr index d23a4dfd0a4..603d42ca35e 100644 --- a/src/test/ui/issues/issue-38919.stderr +++ b/src/test/ui/issues/issue-38919.stderr @@ -2,9 +2,7 @@ error[E0599]: no associated item named `Item` found for type `T` in the current --> $DIR/issue-38919.rs:2:8 | LL | T::Item; - | ---^^^^ - | | - | associated item not found in `T` + | ^^^^ associated item not found in `T` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-39559.stderr b/src/test/ui/issues/issue-39559.stderr index e851e79faee..aded0c2de45 100644 --- a/src/test/ui/issues/issue-39559.stderr +++ b/src/test/ui/issues/issue-39559.stderr @@ -2,9 +2,7 @@ error[E0599]: no function or associated item named `dim` found for type `D` in t --> $DIR/issue-39559.rs:14:21 | LL | entries: [T; D::dim()], - | ---^^^ - | | - | function or associated item not found in `D` + | ^^^ function or associated item not found in `D` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `dim`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-3973.stderr b/src/test/ui/issues/issue-3973.stderr index 2ece4c39606..576da4bcd31 100644 --- a/src/test/ui/issues/issue-3973.stderr +++ b/src/test/ui/issues/issue-3973.stderr @@ -14,9 +14,7 @@ LL | struct Point { | ------------ function or associated item `new` not found for this ... LL | let p = Point::new(0.0, 0.0); - | -------^^^ - | | - | function or associated item not found in `Point` + | ^^^ function or associated item not found in `Point` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-42880.stderr b/src/test/ui/issues/issue-42880.stderr index 8a40a49c0de..763bb9ae0ea 100644 --- a/src/test/ui/issues/issue-42880.stderr +++ b/src/test/ui/issues/issue-42880.stderr @@ -2,7 +2,7 @@ error[E0599]: no associated item named `String` found for type `std::string::Str --> $DIR/issue-42880.rs:4:22 | LL | let f = |&Value::String(_)| (); - | -------^^^^^^--- associated item not found in `std::string::String` + | ^^^^^^ associated item not found in `std::string::String` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-57362-2.stderr b/src/test/ui/issues/issue-57362-2.stderr index 522b201ec78..2e713cc0ab5 100644 --- a/src/test/ui/issues/issue-57362-2.stderr +++ b/src/test/ui/issues/issue-57362-2.stderr @@ -2,9 +2,7 @@ error[E0599]: no function or associated item named `make_g` found for type `for< --> $DIR/issue-57362-2.rs:22:25 | LL | let x = ::make_g(); - | ------------^^^^^^ - | | - | function or associated item not found in `for<'r> fn(&'r ())` + | ^^^^^^ function or associated item not found in `for<'r> fn(&'r ())` | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `make_g`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-7950.stderr b/src/test/ui/issues/issue-7950.stderr index e30f0475376..bbeab405e29 100644 --- a/src/test/ui/issues/issue-7950.stderr +++ b/src/test/ui/issues/issue-7950.stderr @@ -5,9 +5,7 @@ LL | struct Foo; | ----------- function or associated item `bar` not found for this ... LL | Foo::bar(); - | -----^^^ - | | - | function or associated item not found in `Foo` + | ^^^ function or associated item not found in `Foo` error: aborting due to previous error diff --git a/src/test/ui/lexical-scopes.stderr b/src/test/ui/lexical-scopes.stderr index fb823ebde2e..859eb04749f 100644 --- a/src/test/ui/lexical-scopes.stderr +++ b/src/test/ui/lexical-scopes.stderr @@ -12,9 +12,7 @@ error[E0599]: no function or associated item named `f` found for type `Foo` in t --> $DIR/lexical-scopes.rs:10:10 | LL | Foo::f(); - | -----^ - | | - | function or associated item not found in `Foo` + | ^ function or associated item not found in `Foo` error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr b/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr index 1bf9b09fcc5..c672acee040 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/no-double-error.stderr @@ -2,9 +2,7 @@ error[E0599]: no associated item named `XXX` found for type `u32` in the current --> $DIR/no-double-error.rs:8:14 | LL | u32::XXX => { } - | -----^^^ - | | - | associated item not found in `u32` + | ^^^ associated item not found in `u32` error: aborting due to previous error diff --git a/src/test/ui/rust-2018/trait-import-suggestions.stderr b/src/test/ui/rust-2018/trait-import-suggestions.stderr index e2ffeaee4b4..a81181228df 100644 --- a/src/test/ui/rust-2018/trait-import-suggestions.stderr +++ b/src/test/ui/rust-2018/trait-import-suggestions.stderr @@ -30,9 +30,7 @@ error[E0599]: no function or associated item named `from_str` found for type `u3 --> $DIR/trait-import-suggestions.rs:30:18 | LL | let y = u32::from_str("33"); - | -----^^^^^^^^ - | | - | function or associated item not found in `u32` + | ^^^^^^^^ function or associated item 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: diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/trait-item-privacy.stderr index 97e7ed0ebb0..3bf5309ee7d 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/trait-item-privacy.stderr @@ -39,9 +39,7 @@ LL | struct S; | --------- function or associated item `a` not found for this ... LL | S::a(&S); - | ---^ - | | - | function or associated item not found in `S` + | ^ function or associated item 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: @@ -54,9 +52,7 @@ LL | struct S; | --------- function or associated item `b` not found for this ... LL | S::b(&S); - | ---^ - | | - | function or associated item not found in `S` + | ^ function or associated item 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: @@ -77,9 +73,7 @@ LL | struct S; | --------- associated item `A` not found for this ... LL | S::A; - | ---^ - | | - | associated item not found in `S` + | ^ associated item 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: @@ -92,9 +86,7 @@ LL | struct S; | --------- associated item `B` not found for this ... LL | S::B; - | ---^ - | | - | associated item not found in `S` + | ^ associated item 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/ufcs/ufcs-partially-resolved.stderr b/src/test/ui/ufcs/ufcs-partially-resolved.stderr index 799dbf7a6d2..900c7297211 100644 --- a/src/test/ui/ufcs/ufcs-partially-resolved.stderr +++ b/src/test/ui/ufcs/ufcs-partially-resolved.stderr @@ -190,17 +190,13 @@ error[E0599]: no associated item named `NN` found for type `::Y` in th --> $DIR/ufcs-partially-resolved.rs:38:20 | LL | ::Y::NN; - | ---------------^^ - | | - | associated item not found in `::Y` + | ^^ associated item not found in `::Y` error[E0599]: no associated item named `N` found for type `::X` in the current scope --> $DIR/ufcs-partially-resolved.rs:55:20 | LL | ::X::N; - | ---------------^ - | | - | associated item not found in `::X` + | ^ associated item not found in `::X` error: aborting due to 32 previous errors diff --git a/src/test/ui/unspecified-self-in-trait-ref.stderr b/src/test/ui/unspecified-self-in-trait-ref.stderr index b295b39d33c..f894cd36a4f 100644 --- a/src/test/ui/unspecified-self-in-trait-ref.stderr +++ b/src/test/ui/unspecified-self-in-trait-ref.stderr @@ -2,33 +2,25 @@ error[E0599]: no function or associated item named `lol` found for type `dyn Foo --> $DIR/unspecified-self-in-trait-ref.rs:10:18 | LL | let a = Foo::lol(); - | -----^^^ - | | - | function or associated item not found in `dyn Foo<_>` + | ^^^ function or associated item not found in `dyn Foo<_>` error[E0599]: no function or associated item named `lol` found for type `dyn Foo<_>` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:12:23 | LL | let b = Foo::<_>::lol(); - | ----------^^^ - | | - | function or associated item not found in `dyn Foo<_>` + | ^^^ function or associated item not found in `dyn Foo<_>` error[E0599]: no function or associated item named `lol` found for type `dyn Bar<_, _>` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:14:18 | LL | let c = Bar::lol(); - | -----^^^ - | | - | function or associated item not found in `dyn Bar<_, _>` + | ^^^ function or associated item not found in `dyn Bar<_, _>` error[E0599]: no function or associated item named `lol` found for type `dyn Bar` in the current scope --> $DIR/unspecified-self-in-trait-ref.rs:16:30 | LL | let d = Bar::::lol(); - | -----------------^^^ - | | - | function or associated item not found in `dyn Bar` + | ^^^ function or associated item not found in `dyn Bar` error[E0393]: the type parameter `A` must be explicitly specified --> $DIR/unspecified-self-in-trait-ref.rs:18:13