diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-10-12 14:44:16 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-10-28 09:57:36 -0700 |
| commit | 56aa89cdbec7d020dbeff76d0a2f6d0f28a1c12f (patch) | |
| tree | 24dde7918b67cdde52310d44b4d079c7396ae709 /src | |
| parent | 9b4f811b7f646ebb7273fa3cf8f9d092a44058b5 (diff) | |
| download | rust-56aa89cdbec7d020dbeff76d0a2f6d0f28a1c12f.tar.gz rust-56aa89cdbec7d020dbeff76d0a2f6d0f28a1c12f.zip | |
Further tweak spans for better readability
Diffstat (limited to 'src')
5 files changed, 18 insertions, 18 deletions
diff --git a/src/librustc_typeck/coherence/orphan.rs b/src/librustc_typeck/coherence/orphan.rs index 3bcea6d173a..7024927bf8d 100644 --- a/src/librustc_typeck/coherence/orphan.rs +++ b/src/librustc_typeck/coherence/orphan.rs @@ -24,7 +24,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> { fn visit_item(&mut self, item: &hir::Item) { let def_id = self.tcx.hir().local_def_id(item.hir_id); // "Trait" impl - if let hir::ItemKind::Impl(.., generics, Some(_), impl_ty, _) = &item.kind { + if let hir::ItemKind::Impl(.., generics, Some(tr), impl_ty, _) = &item.kind { debug!("coherence2::orphan check: trait impl {}", self.tcx.hir().node_to_string(item.hir_id)); let trait_ref = self.tcx.impl_trait_ref(def_id).unwrap(); @@ -47,7 +47,7 @@ impl ItemLikeVisitor<'v> for OrphanChecker<'tcx> { if *i == 0 { err.span_label(impl_ty.span, &msg); } else { - err.note(&msg); + err.span_label(tr.path.span, &msg); } } err.note("define and implement a trait or new type instead"); diff --git a/src/test/ui/coherence/coherence-orphan.old.stderr b/src/test/ui/coherence/coherence-orphan.old.stderr index 3594224abac..8d360598317 100644 --- a/src/test/ui/coherence/coherence-orphan.old.stderr +++ b/src/test/ui/coherence/coherence-orphan.old.stderr @@ -2,12 +2,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar --> $DIR/coherence-orphan.rs:13:1 | LL | impl TheTrait<usize> for isize { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^----- - | | | - | | `isize` is not defined in the current crate + | ^^^^^---------------^^^^^----- + | | | | + | | | `isize` is not defined in the current crate + | | `usize` is not defined in the current crate | impl doesn't use only types from inside the current crate | - = note: `usize` is not defined in the current crate = note: define and implement a trait or new type instead error[E0117]: only traits defined in the current crate can be implemented for arbitrary types diff --git a/src/test/ui/coherence/coherence-orphan.re.stderr b/src/test/ui/coherence/coherence-orphan.re.stderr index 3594224abac..8d360598317 100644 --- a/src/test/ui/coherence/coherence-orphan.re.stderr +++ b/src/test/ui/coherence/coherence-orphan.re.stderr @@ -2,12 +2,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar --> $DIR/coherence-orphan.rs:13:1 | LL | impl TheTrait<usize> for isize { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^----- - | | | - | | `isize` is not defined in the current crate + | ^^^^^---------------^^^^^----- + | | | | + | | | `isize` is not defined in the current crate + | | `usize` is not defined in the current crate | impl doesn't use only types from inside the current crate | - = note: `usize` is not defined in the current crate = note: define and implement a trait or new type instead error[E0117]: only traits defined in the current crate can be implemented for arbitrary types diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr index 3af9d93833d..db9989c6664 100644 --- a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr +++ b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.re.stderr @@ -2,12 +2,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar --> $DIR/coherence-pair-covered-uncovered-1.rs:15:1 | LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--- - | | | - | | `i32` is not defined in the current crate + | ^^^^^^^^^^^--------------------------^^^^^--- + | | | | + | | | `i32` is not defined in the current crate + | | `lib::Pair<T, Local<U>>` is not defined in the current crate | impl doesn't use only types from inside the current crate | - = note: `lib::Pair<T, Local<U>>` is not defined in the current crate = note: define and implement a trait or new type instead error: aborting due to previous error diff --git a/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr b/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr index 0a36f7cf3c6..07c7632a53f 100644 --- a/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr +++ b/src/test/ui/coherence/impl-foreign[foreign]-for-foreign.stderr @@ -2,12 +2,12 @@ error[E0117]: only traits defined in the current crate can be implemented for ar --> $DIR/impl-foreign[foreign]-for-foreign.rs:12:1 | LL | impl Remote1<u32> for f64 { - | ^^^^^^^^^^^^^^^^^^^^^^--- - | | | - | | `f64` is not defined in the current crate + | ^^^^^------------^^^^^--- + | | | | + | | | `f64` is not defined in the current crate + | | `u32` is not defined in the current crate | impl doesn't use only types from inside the current crate | - = note: `u32` is not defined in the current crate = note: define and implement a trait or new type instead error: aborting due to previous error |
