Skip to content

Commit b89c620

Browse files
committed
Make new information notes instead of labels
1 parent ca94dd5 commit b89c620

36 files changed

+248
-248
lines changed

compiler/rustc_hir_analysis/messages.ftl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,14 @@ hir_analysis_only_current_traits_arbitrary = only traits defined in the current
351351
352352
hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait
353353
354-
hir_analysis_only_current_traits_label = impl doesn't have any local type before any uncovered type parameters
355-
356-
hir_analysis_only_current_traits_label_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
357-
358354
hir_analysis_only_current_traits_name = this is not defined in the current crate because {$name} are always foreign
359355
360356
hir_analysis_only_current_traits_note = define and implement a trait or new type instead
361357
358+
hir_analysis_only_current_traits_note_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
359+
360+
hir_analysis_only_current_traits_note_uncovered = impl doesn't have any local type before any uncovered type parameters
361+
362362
hir_analysis_only_current_traits_opaque = type alias impl trait is treated as if it were foreign, because its hidden type could be from a foreign crate
363363
364364
hir_analysis_only_current_traits_outside = only traits defined in the current crate can be implemented for types defined outside of the crate

compiler/rustc_hir_analysis/src/errors.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,27 +1440,27 @@ pub enum OnlyCurrentTraits {
14401440
#[diag(hir_analysis_only_current_traits_outside, code = E0117)]
14411441
Outside {
14421442
#[primary_span]
1443-
#[label(hir_analysis_only_current_traits_label)]
1444-
#[label(hir_analysis_only_current_traits_label_more_info)]
14451443
span: Span,
1444+
#[note(hir_analysis_only_current_traits_note_uncovered)]
1445+
#[note(hir_analysis_only_current_traits_note_more_info)]
14461446
#[note(hir_analysis_only_current_traits_note)]
14471447
note: (),
14481448
},
14491449
#[diag(hir_analysis_only_current_traits_primitive, code = E0117)]
14501450
Primitive {
14511451
#[primary_span]
1452-
#[label(hir_analysis_only_current_traits_label)]
1453-
#[label(hir_analysis_only_current_traits_label_more_info)]
14541452
span: Span,
1453+
#[note(hir_analysis_only_current_traits_note_uncovered)]
1454+
#[note(hir_analysis_only_current_traits_note_more_info)]
14551455
#[note(hir_analysis_only_current_traits_note)]
14561456
note: (),
14571457
},
14581458
#[diag(hir_analysis_only_current_traits_arbitrary, code = E0117)]
14591459
Arbitrary {
14601460
#[primary_span]
1461-
#[label(hir_analysis_only_current_traits_label)]
1462-
#[label(hir_analysis_only_current_traits_label_more_info)]
14631461
span: Span,
1462+
#[note(hir_analysis_only_current_traits_note_uncovered)]
1463+
#[note(hir_analysis_only_current_traits_note_more_info)]
14641464
#[note(hir_analysis_only_current_traits_note)]
14651465
note: (),
14661466
},

tests/ui/coherence/coherence-cow.re_a.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
33
|
44
LL | impl<T> Remote for Pair<T,Cover<T>> { }
55
| ^^^^^^^^^^^^^^^^^^^----------------
6-
| | |
7-
| | `Pair` is not defined in the current crate
8-
| impl doesn't have any local type before any uncovered type parameters
9-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
6+
| |
7+
| `Pair` is not defined in the current crate
108
|
9+
= note: impl doesn't have any local type before any uncovered type parameters
10+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
1111
= note: define and implement a trait or new type instead
1212

1313
error: aborting due to 1 previous error

tests/ui/coherence/coherence-cow.re_b.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
33
|
44
LL | impl<T> Remote for Pair<Cover<T>,T> { }
55
| ^^^^^^^^^^^^^^^^^^^----------------
6-
| | |
7-
| | `Pair` is not defined in the current crate
8-
| impl doesn't have any local type before any uncovered type parameters
9-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
6+
| |
7+
| `Pair` is not defined in the current crate
108
|
9+
= note: impl doesn't have any local type before any uncovered type parameters
10+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
1111
= note: define and implement a trait or new type instead
1212

1313
error: aborting due to 1 previous error

tests/ui/coherence/coherence-cow.re_c.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
33
|
44
LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
55
| ^^^^^^^^^^^^^^^^^^^^^----------------
6-
| | |
7-
| | `Pair` is not defined in the current crate
8-
| impl doesn't have any local type before any uncovered type parameters
9-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
6+
| |
7+
| `Pair` is not defined in the current crate
108
|
9+
= note: impl doesn't have any local type before any uncovered type parameters
10+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
1111
= note: define and implement a trait or new type instead
1212

1313
error: aborting due to 1 previous error

tests/ui/coherence/coherence-fundamental-trait-objects.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
33
|
44
LL | impl Misc for dyn Fundamental<Local> {}
55
| ^^^^^^^^^^^^^^----------------------
6-
| | |
7-
| | `dyn Fundamental<Local>` is not defined in the current crate
8-
| impl doesn't have any local type before any uncovered type parameters
9-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
6+
| |
7+
| `dyn Fundamental<Local>` is not defined in the current crate
108
|
9+
= note: impl doesn't have any local type before any uncovered type parameters
10+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
1111
= note: define and implement a trait or new type instead
1212

1313
error: aborting due to 1 previous error

tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
3939
|
4040
LL | impl !Send for dyn Marker2 {}
4141
| ^^^^^^^^^^^^^^^-----------
42-
| | |
43-
| | `dyn Marker2` is not defined in the current crate
44-
| impl doesn't have any local type before any uncovered type parameters
45-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
42+
| |
43+
| `dyn Marker2` is not defined in the current crate
4644
|
45+
= note: impl doesn't have any local type before any uncovered type parameters
46+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
4747
= note: define and implement a trait or new type instead
4848

4949
error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)`

tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
3939
|
4040
LL | unsafe impl Send for dyn Marker2 {}
4141
| ^^^^^^^^^^^^^^^^^^^^^-----------
42-
| | |
43-
| | `dyn Marker2` is not defined in the current crate
44-
| impl doesn't have any local type before any uncovered type parameters
45-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
42+
| |
43+
| `dyn Marker2` is not defined in the current crate
4644
|
45+
= note: impl doesn't have any local type before any uncovered type parameters
46+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
4747
= note: define and implement a trait or new type instead
4848

4949
error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)`

tests/ui/coherence/coherence-impls-copy.stderr

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
1313
|
1414
LL | impl Copy for &'static [NotSync] {}
1515
| ^^^^^^^^^^^^^^------------------
16-
| | |
17-
| | this is not defined in the current crate because slices are always foreign
18-
| impl doesn't have any local type before any uncovered type parameters
19-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
16+
| |
17+
| this is not defined in the current crate because slices are always foreign
2018
|
19+
= note: impl doesn't have any local type before any uncovered type parameters
20+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
2121
= note: define and implement a trait or new type instead
2222

2323
error[E0117]: only traits defined in the current crate can be implemented for primitive types
2424
--> $DIR/coherence-impls-copy.rs:5:1
2525
|
2626
LL | impl Copy for i32 {}
2727
| ^^^^^^^^^^^^^^---
28-
| | |
29-
| | `i32` is not defined in the current crate
30-
| impl doesn't have any local type before any uncovered type parameters
31-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
28+
| |
29+
| `i32` is not defined in the current crate
3230
|
31+
= note: impl doesn't have any local type before any uncovered type parameters
32+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
3333
= note: define and implement a trait or new type instead
3434

3535
error[E0206]: the trait `Copy` cannot be implemented for this type
@@ -43,11 +43,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
4343
|
4444
LL | impl Copy for (MyType, MyType) {}
4545
| ^^^^^^^^^^^^^^----------------
46-
| | |
47-
| | this is not defined in the current crate because tuples are always foreign
48-
| impl doesn't have any local type before any uncovered type parameters
49-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
46+
| |
47+
| this is not defined in the current crate because tuples are always foreign
5048
|
49+
= note: impl doesn't have any local type before any uncovered type parameters
50+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
5151
= note: define and implement a trait or new type instead
5252

5353
error[E0206]: the trait `Copy` cannot be implemented for this type
@@ -61,11 +61,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
6161
|
6262
LL | impl Copy for [MyType] {}
6363
| ^^^^^^^^^^^^^^--------
64-
| | |
65-
| | this is not defined in the current crate because slices are always foreign
66-
| impl doesn't have any local type before any uncovered type parameters
67-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
64+
| |
65+
| this is not defined in the current crate because slices are always foreign
6866
|
67+
= note: impl doesn't have any local type before any uncovered type parameters
68+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
6969
= note: define and implement a trait or new type instead
7070

7171
error[E0206]: the trait `Copy` cannot be implemented for this type

tests/ui/coherence/coherence-impls-send.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
33
|
44
LL | unsafe impl Send for &'static [NotSync] {}
55
| ^^^^^^^^^^^^^^^^^^^^^------------------
6-
| | |
7-
| | this is not defined in the current crate because slices are always foreign
8-
| impl doesn't have any local type before any uncovered type parameters
9-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
6+
| |
7+
| this is not defined in the current crate because slices are always foreign
108
|
9+
= note: impl doesn't have any local type before any uncovered type parameters
10+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
1111
= note: define and implement a trait or new type instead
1212

1313
error[E0117]: only traits defined in the current crate can be implemented for arbitrary types
1414
--> $DIR/coherence-impls-send.rs:16:1
1515
|
1616
LL | unsafe impl Send for (MyType, MyType) {}
1717
| ^^^^^^^^^^^^^^^^^^^^^----------------
18-
| | |
19-
| | this is not defined in the current crate because tuples are always foreign
20-
| impl doesn't have any local type before any uncovered type parameters
21-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
18+
| |
19+
| this is not defined in the current crate because tuples are always foreign
2220
|
21+
= note: impl doesn't have any local type before any uncovered type parameters
22+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
2323
= note: define and implement a trait or new type instead
2424

2525
error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `&'static NotSync`
@@ -33,11 +33,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
3333
|
3434
LL | unsafe impl Send for [MyType] {}
3535
| ^^^^^^^^^^^^^^^^^^^^^--------
36-
| | |
37-
| | this is not defined in the current crate because slices are always foreign
38-
| impl doesn't have any local type before any uncovered type parameters
39-
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
36+
| |
37+
| this is not defined in the current crate because slices are always foreign
4038
|
39+
= note: impl doesn't have any local type before any uncovered type parameters
40+
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
4141
= note: define and implement a trait or new type instead
4242

4343
error: aborting due to 4 previous errors

0 commit comments

Comments
 (0)