Skip to content

Commit 892d585

Browse files
committed
Add a new test ui/incoherent-inherent-impls/no-other-unrelated-errors to check E0116 does not cause unrelated errors
rustc xxx (we do not know) to 1.82.0 emits unrelated errors when E0116 is present (see rust-lang#125814). We do not know what caused and fixed it, but add a test to confirm rustc does not cause the same error in the future.
1 parent acabb52 commit 892d585

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// E0116 caused other unrelated errors, so check no unrelated errors are emmitted.
2+
3+
fn main() {
4+
let x = "hello";
5+
x.split(" ");
6+
}
7+
8+
impl Vec<usize> {} //~ ERROR E0116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined
2+
--> $DIR/no-other-unrelated-errors.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: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0116`.

0 commit comments

Comments
 (0)