Skip to content

Commit 33dc44a

Browse files
committed
Remove stray . from error message
1 parent 3d5d7a2 commit 33dc44a

File tree

6 files changed

+33
-7
lines changed

6 files changed

+33
-7
lines changed

compiler/rustc_hir_analysis/messages.ftl

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ hir_analysis_inherent_ty_outside = cannot define inherent `impl` for a type outs
194194
.span_help = alternatively add `#[rustc_has_incoherent_inherent_impls]` to the type and `#[rustc_allow_incoherent_impl]` to the relevant impl items
195195
196196
hir_analysis_inherent_ty_outside_new = cannot define inherent `impl` for a type outside of the crate where the type is defined
197-
.label = impl for type defined outside of crate.
197+
.label = impl for type defined outside of crate
198198
.note = define and implement a trait or new type instead
199199
200200
hir_analysis_inherent_ty_outside_primitive = cannot define inherent `impl` for primitive types outside of `core`

tests/ui/error-codes/E0116.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
22
--> $DIR/E0116.rs:1:1
33
|
44
LL | impl Vec<u8> {}
5-
| ^^^^^^^^^^^^ impl for type defined outside of crate.
5+
| ^^^^^^^^^^^^ impl for type defined outside of crate
66
|
77
= note: define and implement a trait or new type instead
88

tests/ui/incoherent-inherent-impls/no-attr-empty-impl.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
22
--> $DIR/no-attr-empty-impl.rs:4:1
33
|
44
LL | impl extern_crate::StructWithAttr {}
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate
66
|
77
= note: define and implement a trait or new type instead
88

99
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
1010
--> $DIR/no-attr-empty-impl.rs:7:1
1111
|
1212
LL | impl extern_crate::StructNoAttr {}
13-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
13+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate
1414
|
1515
= note: define and implement a trait or new type instead
1616

1717
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
1818
--> $DIR/no-attr-empty-impl.rs:10:1
1919
|
2020
LL | impl extern_crate::EnumWithAttr {}
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
21+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate
2222
|
2323
= note: define and implement a trait or new type instead
2424

2525
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
2626
--> $DIR/no-attr-empty-impl.rs:13:1
2727
|
2828
LL | impl extern_crate::EnumNoAttr {}
29-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl for type defined outside of crate
3030
|
3131
= note: define and implement a trait or new type instead
3232

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn main() {
2+
let x = "hello";
3+
// FIXME: the error below shouldn't happen. For that we need to modify `crate_inherent_impls`.
4+
// https://github.com/rust-lang/rust/issues/125814
5+
x.split(" "); //~ ERROR E0599
6+
}
7+
8+
impl Vec<usize> {} //~ ERROR E0116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
2+
--> $DIR/inherent-impls-missing-due-to-bad-impl.rs:8:1
3+
|
4+
LL | impl Vec<usize> {}
5+
| ^^^^^^^^^^^^^^^ impl for type defined outside of crate
6+
|
7+
= note: define and implement a trait or new type instead
8+
9+
error[E0599]: no method named `split` found for reference `&str` in the current scope
10+
--> $DIR/inherent-impls-missing-due-to-bad-impl.rs:5:7
11+
|
12+
LL | x.split(" ");
13+
| ^^^^^ method not found in `&str`
14+
15+
error: aborting due to 2 previous errors
16+
17+
Some errors have detailed explanations: E0116, E0599.
18+
For more information about an error, try `rustc --explain E0116`.

tests/ui/traits/trait-or-new-type-instead.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0116]: cannot define inherent `impl` for a type outside of the crate wher
22
--> $DIR/trait-or-new-type-instead.rs:1:1
33
|
44
LL | impl<T> Option<T> {
5-
| ^^^^^^^^^^^^^^^^^ impl for type defined outside of crate.
5+
| ^^^^^^^^^^^^^^^^^ impl for type defined outside of crate
66
|
77
= note: define and implement a trait or new type instead
88

0 commit comments

Comments
 (0)