Skip to content

Commit 510f836

Browse files
committed
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.
1 parent a5d3563 commit 510f836

File tree

6 files changed

+6
-34
lines changed

6 files changed

+6
-34
lines changed

src/librustc_typeck/astconv.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1068,10 +1068,12 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx>+'o {
10681068
span,
10691069
format!("associated type `{}` must be specified", assoc_item.ident),
10701070
);
1071-
err.span_label(
1072-
tcx.def_span(*item_def_id),
1073-
format!("`{}` defined here", assoc_item.ident),
1074-
);
1071+
if item_def_id.is_local() {
1072+
err.span_label(
1073+
tcx.def_span(*item_def_id),
1074+
format!("`{}` defined here", assoc_item.ident),
1075+
);
1076+
}
10751077
if suggest {
10761078
if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(
10771079
potential_assoc_types_spans[i],

src/test/ui/issues/issue-21950.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
1111
|
1212
LL | &Add;
1313
| ^^^ associated type `Output` must be specified
14-
|
15-
::: $SRC_DIR/libcore/ops/arith.rs:LL:COL
16-
|
17-
LL | type Output;
18-
| ------------ `Output` defined here
1914

2015
error: aborting due to 2 previous errors
2116

src/test/ui/issues/issue-22560.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ LL | | //~^ ERROR E0393
2929
LL | | //~| ERROR E0191
3030
LL | | Sub;
3131
| |_______________^ associated type `Output` must be specified
32-
|
33-
::: $SRC_DIR/libcore/ops/arith.rs:LL:COL
34-
|
35-
LL | type Output;
36-
| ------------ `Output` defined here
3732

3833
error: aborting due to 4 previous errors
3934

src/test/ui/issues/issue-23024.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
1717
|
1818
LL | println!("{:?}",(vfnfer[0] as Fn)(3));
1919
| ^^ associated type `Output` must be specified
20-
|
21-
::: $SRC_DIR/libcore/ops/function.rs:LL:COL
22-
|
23-
LL | type Output;
24-
| ------------ `Output` defined here
2520

2621
error: aborting due to 3 previous errors
2722

src/test/ui/issues/issue-28344.stderr

-10
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
33
|
44
LL | let x: u8 = BitXor::bitor(0 as u8, 0 as u8);
55
| ^^^^^^^^^^^^^ associated type `Output` must be specified
6-
|
7-
::: $SRC_DIR/libcore/ops/bit.rs:LL:COL
8-
|
9-
LL | type Output;
10-
| ------------ `Output` defined here
116

127
error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope
138
--> $DIR/issue-28344.rs:14:17
@@ -22,11 +17,6 @@ error[E0191]: the value of the associated type `Output` (from the trait `std::op
2217
|
2318
LL | let g = BitXor::bitor;
2419
| ^^^^^^^^^^^^^ associated type `Output` must be specified
25-
|
26-
::: $SRC_DIR/libcore/ops/bit.rs:LL:COL
27-
|
28-
LL | type Output;
29-
| ------------ `Output` defined here
3020

3121
error[E0599]: no function or associated item named `bitor` found for type `dyn std::ops::BitXor<_>` in the current scope
3222
--> $DIR/issue-28344.rs:18:13

src/test/ui/traits/trait-alias-object.stderr

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ error[E0191]: the value of the associated type `Item` (from the trait `std::iter
1111
|
1212
LL | let _: &dyn IteratorAlias = &vec![123].into_iter();
1313
| ^^^^^^^^^^^^^^^^^ associated type `Item` must be specified
14-
|
15-
::: $SRC_DIR/libcore/iter/iterator.rs:LL:COL
16-
|
17-
LL | type Item;
18-
| ---------- `Item` defined here
1914

2015
error: aborting due to 2 previous errors
2116

0 commit comments

Comments
 (0)