diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index f46c43c78db..68996f5aaf9 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -758,11 +758,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { MethodError::Ambiguity(sources) => { let mut err = struct_span_err!( self.sess(), - span, + item_name.span, E0034, "multiple applicable items in scope" ); - err.span_label(span, format!("multiple `{}` found", item_name)); + err.span_label(item_name.span, format!("multiple `{}` found", item_name)); report_candidates(span, &mut err, sources, sugg_span); err.emit(); @@ -772,13 +772,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { let kind = kind.descr(def_id); let mut err = struct_span_err!( self.tcx.sess, - span, + item_name.span, E0624, "{} `{}` is private", kind, item_name ); - err.span_label(span, &format!("private {}", kind)); + err.span_label(item_name.span, &format!("private {}", kind)); self.suggest_valid_traits(&mut err, out_of_scope_traits); err.emit(); } diff --git a/src/test/ui/associated-const/associated-const-ambiguity-report.stderr b/src/test/ui/associated-const/associated-const-ambiguity-report.stderr index 92a8d19021a..c5e32afbbce 100644 --- a/src/test/ui/associated-const/associated-const-ambiguity-report.stderr +++ b/src/test/ui/associated-const/associated-const-ambiguity-report.stderr @@ -1,8 +1,8 @@ error[E0034]: multiple applicable items in scope - --> $DIR/associated-const-ambiguity-report.rs:17:16 + --> $DIR/associated-const-ambiguity-report.rs:17:23 | LL | const X: i32 = ::ID; - | ^^^^^^^^^ multiple `ID` found + | ^^ multiple `ID` found | note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32` --> $DIR/associated-const-ambiguity-report.rs:10:5 diff --git a/src/test/ui/associated-const/associated-const-private-impl.stderr b/src/test/ui/associated-const/associated-const-private-impl.stderr index 305f41433ac..1b9d7ac7e6c 100644 --- a/src/test/ui/associated-const/associated-const-private-impl.stderr +++ b/src/test/ui/associated-const/associated-const-private-impl.stderr @@ -1,8 +1,8 @@ error[E0624]: associated constant `ID` is private - --> $DIR/associated-const-private-impl.rs:13:19 + --> $DIR/associated-const-private-impl.rs:13:30 | LL | assert_eq!(1, bar1::Foo::ID); - | ^^^^^^^^^^^^^ private associated constant + | ^^ private associated constant error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0034.stderr b/src/test/ui/error-codes/E0034.stderr index 6db2ef5051d..7977e529a11 100644 --- a/src/test/ui/error-codes/E0034.stderr +++ b/src/test/ui/error-codes/E0034.stderr @@ -1,8 +1,8 @@ error[E0034]: multiple applicable items in scope - --> $DIR/E0034.rs:20:5 + --> $DIR/E0034.rs:20:11 | LL | Test::foo() - | ^^^^^^^^^ multiple `foo` found + | ^^^ multiple `foo` found | note: candidate #1 is defined in an impl of the trait `Trait1` for the type `Test` --> $DIR/E0034.rs:12:5 diff --git a/src/test/ui/issues/issue-21202.stderr b/src/test/ui/issues/issue-21202.stderr index 421ed0a5a93..9b3b7a72e04 100644 --- a/src/test/ui/issues/issue-21202.stderr +++ b/src/test/ui/issues/issue-21202.stderr @@ -1,8 +1,8 @@ error[E0624]: associated function `foo` is private - --> $DIR/issue-21202.rs:10:9 + --> $DIR/issue-21202.rs:10:14 | LL | Foo::foo(&f); - | ^^^^^^^^ private associated function + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/issues/issue-53498.stderr b/src/test/ui/issues/issue-53498.stderr index 973e6c12aa1..3c0f7f2b550 100644 --- a/src/test/ui/issues/issue-53498.stderr +++ b/src/test/ui/issues/issue-53498.stderr @@ -1,8 +1,8 @@ error[E0624]: associated function `foo` is private - --> $DIR/issue-53498.rs:16:5 + --> $DIR/issue-53498.rs:16:27 | LL | test::Foo::::foo(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ private associated function + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr b/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr index 44f85071505..24946410887 100644 --- a/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr +++ b/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr @@ -1,8 +1,8 @@ error[E0034]: multiple applicable items in scope - --> $DIR/method-ambig-two-traits-from-impls2.rs:15:5 + --> $DIR/method-ambig-two-traits-from-impls2.rs:15:9 | LL | AB::foo(); - | ^^^^^^^ multiple `foo` found + | ^^^ multiple `foo` found | note: candidate #1 is defined in an impl of the trait `A` for the type `AB` --> $DIR/method-ambig-two-traits-from-impls2.rs:7:5 diff --git a/src/test/ui/privacy/privacy1.stderr b/src/test/ui/privacy/privacy1.stderr index fee6f8d5639..65c10a7bca7 100644 --- a/src/test/ui/privacy/privacy1.stderr +++ b/src/test/ui/privacy/privacy1.stderr @@ -155,28 +155,28 @@ LL | trait B { | ^^^^^^^ error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:77:9 + --> $DIR/privacy1.rs:77:23 | LL | self::baz::A::bar(); - | ^^^^^^^^^^^^^^^^^ private associated function + | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:95:5 + --> $DIR/privacy1.rs:95:13 | LL | bar::A::bar(); - | ^^^^^^^^^^^ private associated function + | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:102:9 + --> $DIR/privacy1.rs:102:19 | LL | ::bar::A::bar(); - | ^^^^^^^^^^^^^ private associated function + | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:105:9 + --> $DIR/privacy1.rs:105:24 | LL | ::bar::baz::A::bar(); - | ^^^^^^^^^^^^^^^^^^ private associated function + | ^^^ private associated function error[E0624]: associated function `bar2` is private --> $DIR/privacy1.rs:108:23 diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index 5bcccc6d69c..40512a34bd9 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -59,10 +59,10 @@ LL | S::default().f(); | ^ private associated function error[E0624]: associated function `g` is private - --> $DIR/test.rs:33:5 + --> $DIR/test.rs:33:8 | LL | S::g(); - | ^^^^ private associated function + | ^ private associated function error[E0616]: field `y` of struct `pub_restricted::Universe` is private --> $DIR/test.rs:42:15 diff --git a/src/test/ui/static/static-method-privacy.stderr b/src/test/ui/static/static-method-privacy.stderr index bc35b4067a8..569608780de 100644 --- a/src/test/ui/static/static-method-privacy.stderr +++ b/src/test/ui/static/static-method-privacy.stderr @@ -1,8 +1,8 @@ error[E0624]: associated function `new` is private - --> $DIR/static-method-privacy.rs:9:13 + --> $DIR/static-method-privacy.rs:9:19 | LL | let _ = a::S::new(); - | ^^^^^^^^^ private associated function + | ^^^ private associated function 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 f8ffc949b06..7fd5c11fcf0 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/trait-item-privacy.stderr @@ -74,10 +74,10 @@ LL | use method::B; | error[E0624]: associated function `a` is private - --> $DIR/trait-item-privacy.rs:84:5 + --> $DIR/trait-item-privacy.rs:84:8 | LL | C::a(&S); - | ^^^^ private associated function + | ^ private associated function error[E0599]: no associated item named `A` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:97:8 @@ -111,10 +111,10 @@ LL | use assoc_const::B; | error[E0624]: associated constant `A` is private - --> $DIR/trait-item-privacy.rs:101:5 + --> $DIR/trait-item-privacy.rs:101:8 | LL | C::A; - | ^^^^ private associated constant + | ^ private associated constant error[E0038]: the trait `assoc_const::C` cannot be made into an object --> $DIR/trait-item-privacy.rs:101:5 diff --git a/src/test/ui/xc-private-method.stderr b/src/test/ui/xc-private-method.stderr index 902998cf0c1..8b7e43ccc04 100644 --- a/src/test/ui/xc-private-method.stderr +++ b/src/test/ui/xc-private-method.stderr @@ -1,14 +1,14 @@ error[E0624]: associated function `static_meth_struct` is private - --> $DIR/xc-private-method.rs:6:13 + --> $DIR/xc-private-method.rs:6:44 | LL | let _ = xc_private_method_lib::Struct::static_meth_struct(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private associated function + | ^^^^^^^^^^^^^^^^^^ private associated function error[E0624]: associated function `static_meth_enum` is private - --> $DIR/xc-private-method.rs:9:13 + --> $DIR/xc-private-method.rs:9:42 | LL | let _ = xc_private_method_lib::Enum::static_meth_enum(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private associated function + | ^^^^^^^^^^^^^^^^ private associated function error: aborting due to 2 previous errors