forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// E0116 caused other unrelated errors, so check no unrelated errors are emmitted. | ||
|
||
fn main() { | ||
let x = "hello"; | ||
x.split(" "); | ||
} | ||
|
||
impl Vec<usize> {} //~ ERROR E0116 |
11 changes: 11 additions & 0 deletions
11
tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined | ||
--> $DIR/no-other-unrelated-errors.rs:8:1 | ||
| | ||
LL | impl Vec<usize> {} | ||
| ^^^^^^^^^^^^^^^ impl for type defined outside of crate | ||
| | ||
= note: define and implement a trait or new type instead | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0116`. |