diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2018-11-22 14:30:33 -0800 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2018-11-22 14:30:33 -0800 |
| commit | 510f836d2378bc9d7ec48e3c39ca83006aadb197 (patch) | |
| tree | 979658aac0cd7beb7938957a916c94f174cfb209 | |
| parent | a5d35631febf78027e5dd7f741bb9f07897d4eda (diff) | |
| download | rust-510f836d2378bc9d7ec48e3c39ca83006aadb197.tar.gz rust-510f836d2378bc9d7ec48e3c39ca83006aadb197.zip | |
Do not point at associated types from other crates
This is a somewhat arbitrary restriction in order to be consistent in the output of the tests regardless of target platform.
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-21950.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-22560.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-23024.stderr | 5 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-28344.stderr | 10 | ||||
| -rw-r--r-- | src/test/ui/traits/trait-alias-object.stderr | 5 |
6 files changed, 6 insertions, 34 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index b583c0554e8..a8164c85e82 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1068,10 +1068,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o { span, format!("associated type `{}` must be specified", assoc_item.ident), ); - err.span_label( - tcx.def_span(*item_def_id), - format!("`{}` defined here", assoc_item.ident), - ); + if item_def_id.is_local() { + err.span_label( + tcx.def_span(*item_def_id), + format!("`{}` defined here", assoc_item.ident), + ); + } if suggest { if let Ok(snippet) = tcx.sess.source_map().span_to_snippet( potential_assoc_types_spans[i], diff --git a/src/test/ui/issues/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr index 2cc064dad1b..33c89dd4994 100644 --- a/src/test/ui/issues/issue-21950.stderr +++ b/src/test/ui/issues/issue-21950.stderr @@ -11,11 +11,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op | LL | &Add; | ^^^ associated type `Output` must be specified - | - ::: $SRC_DIR/libcore/ops/arith.rs:LL:COL - | -LL | type Output; - | ------------ `Output` defined here error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-22560.stderr b/src/test/ui/issues/issue-22560.stderr index bfce870196a..715f84011f6 100644 --- a/src/test/ui/issues/issue-22560.stderr +++ b/src/test/ui/issues/issue-22560.stderr @@ -29,11 +29,6 @@ LL | | //~^ ERROR E0393 LL | | //~| ERROR E0191 LL | | Sub; | |_______________^ associated type `Output` must be specified - | - ::: $SRC_DIR/libcore/ops/arith.rs:LL:COL - | -LL | type Output; - | ------------ `Output` defined here error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr index 198469ca723..adee12a36d3 100644 --- a/src/test/ui/issues/issue-23024.stderr +++ b/src/test/ui/issues/issue-23024.stderr @@ -17,11 +17,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op | LL | println!("{:?}",(vfnfer[0] as Fn)(3)); | ^^ associated type `Output` must be specified - | - ::: $SRC_DIR/libcore/ops/function.rs:LL:COL - | -LL | type Output; - | ------------ `Output` defined here error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr index 824ba4b49cb..734c761d0b7 100644 --- a/src/test/ui/issues/issue-28344.stderr +++ b/src/test/ui/issues/issue-28344.stderr @@ -3,11 +3,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op | LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8); | ^^^^^^^^^^^^^ associated type `Output` must be specified - | - ::: $SRC_DIR/libcore/ops/bit.rs:LL:COL - | -LL | type Output; - | ------------ `Output` defined here error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope --> $DIR/issue-28344.rs:14:17 @@ -22,11 +17,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op | LL | let g = BitXor::bitor; | ^^^^^^^^^^^^^ associated type `Output` must be specified - | - ::: $SRC_DIR/libcore/ops/bit.rs:LL:COL - | -LL | type Output; - | ------------ `Output` defined here error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope --> $DIR/issue-28344.rs:18:13 diff --git a/src/test/ui/traits/trait-alias-object.stderr b/src/test/ui/traits/trait-alias-object.stderr index c316c4a6beb..fdb9427cba7 100644 --- a/src/test/ui/traits/trait-alias-object.stderr +++ b/src/test/ui/traits/trait-alias-object.stderr @@ -11,11 +11,6 @@ error[E0191]: the value of the associated type `Item` (from the trait `std::iter | LL | let _: &dyn IteratorAlias = &vec![123].into_iter(); | ^^^^^^^^^^^^^^^^^ associated type `Item` must be specified - | - ::: $SRC_DIR/libcore/iter/iterator.rs:LL:COL - | -LL | type Item; - | ---------- `Item` defined here error: aborting due to 2 previous errors |
