diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 9d9a027645f..85ec81a9534 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -937,6 +937,7 @@ pub(super) fn instantiate_poly_trait_ref_inner( bounds, speculative, &mut dup_bindings, + span, ); // Okay to ignore `Err` because of `ErrorReported` (see above). } @@ -1189,6 +1190,7 @@ fn add_predicates_for_ast_type_binding( bounds: &mut Bounds<'tcx>, speculative: bool, dup_bindings: &mut FxHashMap, + path_span: Span, ) -> Result<(), ErrorReported> { let tcx = self.tcx(); @@ -1259,7 +1261,7 @@ fn add_predicates_for_ast_type_binding( || traits::supertraits(tcx, trait_ref), &trait_ref.print_only_trait_path().to_string(), binding.item_name, - binding.span, + path_span, ) }?; diff --git a/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr index 4f14cffb065..9a5787db41e 100644 --- a/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr +++ b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr @@ -26,7 +26,7 @@ LL | fn dent(c: C, color: ::Color) { | ^^^^^^^^^^^^^^^^^^^^^ error[E0221]: ambiguous associated type `Color` in bounds of `BoxCar` - --> $DIR/associated-type-projection-from-multiple-supertraits.rs:25:37 + --> $DIR/associated-type-projection-from-multiple-supertraits.rs:25:30 | LL | type Color; | ----------- ambiguous `Color` from `Vehicle` @@ -35,16 +35,16 @@ LL | type Color; | ----------- ambiguous `Color` from `Box` ... LL | fn dent_object(c: dyn BoxCar) { - | ^^^^^^^^^^^ ambiguous associated type `Color` + | ^^^^^^^^^^^^^^^^^^^ ambiguous associated type `Color` | help: use fully qualified syntax to disambiguate | -LL | fn dent_object(c: dyn BoxCar<::Color>) { - | ^^^^^^^^^^^^^^^^^^^^^^ +LL | fn dent_object(c: dyn ::Color) { + | ^^^^^^^^^^^^^^^^^^^^^^ help: use fully qualified syntax to disambiguate | -LL | fn dent_object(c: dyn BoxCar<::Color>) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | fn dent_object(c: dyn ::Color) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0191]: the value of the associated type `Color` (from trait `Vehicle`) must be specified --> $DIR/associated-type-projection-from-multiple-supertraits.rs:25:30 diff --git a/src/test/ui/error-codes/E0220.stderr b/src/test/ui/error-codes/E0220.stderr index 58a92fe9832..73e66ceb845 100644 --- a/src/test/ui/error-codes/E0220.stderr +++ b/src/test/ui/error-codes/E0220.stderr @@ -1,8 +1,8 @@ error[E0220]: associated type `F` not found for `Trait` - --> $DIR/E0220.rs:5:22 + --> $DIR/E0220.rs:5:16 | LL | type Foo = dyn Trait; - | ^^^^^ associated type `F` not found + | ^^^^^^^^^^^^ associated type `F` not found error[E0191]: the value of the associated type `Bar` (from trait `Trait`) must be specified --> $DIR/E0220.rs:5:16 diff --git a/src/test/ui/span/type-binding.stderr b/src/test/ui/span/type-binding.stderr index c3e95455532..5b64fe18892 100644 --- a/src/test/ui/span/type-binding.stderr +++ b/src/test/ui/span/type-binding.stderr @@ -1,5 +1,5 @@ error[E0220]: associated type `Trget` not found for `std::ops::Deref` - --> $DIR/type-binding.rs:6:20 + --> $DIR/type-binding.rs:6:14 | LL | fn homura>(_: T) {} | ^^^^^^^^^^^ help: there is an associated type with a similar name: `Target` diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr index c81402a3dcc..ff65fd968c5 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr @@ -5,10 +5,10 @@ LL | fn f isize>(x: F) {} | ^^^^^^^^^^^^ unexpected type argument error[E0220]: associated type `Output` not found for `Trait` - --> $DIR/unboxed-closure-sugar-wrong-trait.rs:5:24 + --> $DIR/unboxed-closure-sugar-wrong-trait.rs:5:8 | LL | fn f isize>(x: F) {} - | ^^^^^ associated type `Output` not found + | ^^^^^^^^^^^^^^^^^^^^^ associated type `Output` not found error: aborting due to 2 previous errors