diff --git a/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs b/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs new file mode 100644 index 0000000000000..8eaa0c9194a80 --- /dev/null +++ b/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.rs @@ -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 {} //~ ERROR E0116 diff --git a/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.stderr b/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.stderr new file mode 100644 index 0000000000000..2a33262f83898 --- /dev/null +++ b/tests/ui/incoherent-inherent-impls/no-other-unrelated-errors.stderr @@ -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 {} + | ^^^^^^^^^^^^^^^ 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`.