Skip to content

Commit

Permalink
Make new information notes instead of labels
Browse files Browse the repository at this point in the history
  • Loading branch information
cafce25 committed Sep 26, 2024
1 parent ca94dd5 commit b89c620
Show file tree
Hide file tree
Showing 36 changed files with 248 additions and 248 deletions.
8 changes: 4 additions & 4 deletions compiler/rustc_hir_analysis/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,14 @@ hir_analysis_only_current_traits_arbitrary = only traits defined in the current
hir_analysis_only_current_traits_foreign = this is not defined in the current crate because this is a foreign trait
hir_analysis_only_current_traits_label = impl doesn't have any local type before any uncovered type parameters
hir_analysis_only_current_traits_label_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
hir_analysis_only_current_traits_name = this is not defined in the current crate because {$name} are always foreign
hir_analysis_only_current_traits_note = define and implement a trait or new type instead
hir_analysis_only_current_traits_note_more_info = for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
hir_analysis_only_current_traits_note_uncovered = impl doesn't have any local type before any uncovered type parameters
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
hir_analysis_only_current_traits_outside = only traits defined in the current crate can be implemented for types defined outside of the crate
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_hir_analysis/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1440,27 +1440,27 @@ pub enum OnlyCurrentTraits {
#[diag(hir_analysis_only_current_traits_outside, code = E0117)]
Outside {
#[primary_span]
#[label(hir_analysis_only_current_traits_label)]
#[label(hir_analysis_only_current_traits_label_more_info)]
span: Span,
#[note(hir_analysis_only_current_traits_note_uncovered)]
#[note(hir_analysis_only_current_traits_note_more_info)]
#[note(hir_analysis_only_current_traits_note)]
note: (),
},
#[diag(hir_analysis_only_current_traits_primitive, code = E0117)]
Primitive {
#[primary_span]
#[label(hir_analysis_only_current_traits_label)]
#[label(hir_analysis_only_current_traits_label_more_info)]
span: Span,
#[note(hir_analysis_only_current_traits_note_uncovered)]
#[note(hir_analysis_only_current_traits_note_more_info)]
#[note(hir_analysis_only_current_traits_note)]
note: (),
},
#[diag(hir_analysis_only_current_traits_arbitrary, code = E0117)]
Arbitrary {
#[primary_span]
#[label(hir_analysis_only_current_traits_label)]
#[label(hir_analysis_only_current_traits_label_more_info)]
span: Span,
#[note(hir_analysis_only_current_traits_note_uncovered)]
#[note(hir_analysis_only_current_traits_note_more_info)]
#[note(hir_analysis_only_current_traits_note)]
note: (),
},
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/coherence/coherence-cow.re_a.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
|
LL | impl<T> Remote for Pair<T,Cover<T>> { }
| ^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `Pair` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `Pair` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error: aborting due to 1 previous error
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/coherence/coherence-cow.re_b.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
|
LL | impl<T> Remote for Pair<Cover<T>,T> { }
| ^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `Pair` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `Pair` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error: aborting due to 1 previous error
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/coherence/coherence-cow.re_c.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ty
|
LL | impl<T,U> Remote for Pair<Cover<T>,U> { }
| ^^^^^^^^^^^^^^^^^^^^^----------------
| | |
| | `Pair` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `Pair` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error: aborting due to 1 previous error
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/coherence/coherence-fundamental-trait-objects.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl Misc for dyn Fundamental<Local> {}
| ^^^^^^^^^^^^^^----------------------
| | |
| | `dyn Fundamental<Local>` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `dyn Fundamental<Local>` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error: aborting due to 1 previous error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl !Send for dyn Marker2 {}
| ^^^^^^^^^^^^^^^-----------
| | |
| | `dyn Marker2` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `dyn Marker2` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | unsafe impl Send for dyn Marker2 {}
| ^^^^^^^^^^^^^^^^^^^^^-----------
| | |
| | `dyn Marker2` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `dyn Marker2` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)`
Expand Down
32 changes: 16 additions & 16 deletions tests/ui/coherence/coherence-impls-copy.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl Copy for &'static [NotSync] {}
| ^^^^^^^^^^^^^^------------------
| | |
| | this is not defined in the current crate because slices are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because slices are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

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

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

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

error[E0206]: the trait `Copy` cannot be implemented for this type
Expand Down
24 changes: 12 additions & 12 deletions tests/ui/coherence/coherence-impls-send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | unsafe impl Send for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^^^^^^^------------------
| | |
| | this is not defined in the current crate because slices are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because slices are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= 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
--> $DIR/coherence-impls-send.rs:16:1
|
LL | unsafe impl Send for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^^^^^^^----------------
| | |
| | this is not defined in the current crate because tuples are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because tuples are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

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

error: aborting due to 4 previous errors
Expand Down
24 changes: 12 additions & 12 deletions tests/ui/coherence/coherence-impls-sized.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl Sized for (MyType, MyType) {}
| ^^^^^^^^^^^^^^^----------------
| | |
| | this is not defined in the current crate because tuples are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because tuples are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error[E0322]: explicit impls for the `Sized` trait are not permitted
Expand All @@ -45,11 +45,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl Sized for [MyType] {}
| ^^^^^^^^^^^^^^^--------
| | |
| | this is not defined in the current crate because slices are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because slices are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error[E0322]: explicit impls for the `Sized` trait are not permitted
Expand All @@ -63,11 +63,11 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl Sized for &'static [NotSync] {}
| ^^^^^^^^^^^^^^^------------------
| | |
| | this is not defined in the current crate because slices are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because slices are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error: aborting due to 9 previous errors
Expand Down
24 changes: 12 additions & 12 deletions tests/ui/coherence/coherence-negative-impls-copy-bad.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@ error[E0117]: only traits defined in the current crate can be implemented for ar
|
LL | impl !Copy for str {}
| ^^^^^^^^^^^^^^^---
| | |
| | `str` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `str` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= 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
--> $DIR/coherence-negative-impls-copy-bad.rs:7:1
|
LL | impl !Copy for fn() {}
| ^^^^^^^^^^^^^^^----
| | |
| | `fn()` is not defined in the current crate
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| `fn()` is not defined in the current crate
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= 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
--> $DIR/coherence-negative-impls-copy-bad.rs:10:1
|
LL | impl !Copy for () {}
| ^^^^^^^^^^^^^^^--
| | |
| | this is not defined in the current crate because tuples are always foreign
| impl doesn't have any local type before any uncovered type parameters
| for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
| |
| this is not defined in the current crate because tuples are always foreign
|
= note: impl doesn't have any local type before any uncovered type parameters
= note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules
= note: define and implement a trait or new type instead

error: aborting due to 3 previous errors
Expand Down
Loading

0 comments on commit b89c620

Please sign in to comment.