about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2024-01-01 23:54:20 +0100
committerNadrieril <nadrieril+git@gmail.com>2024-01-07 22:13:08 +0100
commit4b2e8bc8416003663530c45c84eac70116d01f92 (patch)
tree8dc10bdef6c33949fa1ae4c14f06520be744f503 /tests/ui
parent07d5f1942680c18f88e27678d9ca995a77b4c15c (diff)
downloadrust-4b2e8bc8416003663530c45c84eac70116d01f92.tar.gz
rust-4b2e8bc8416003663530c45c84eac70116d01f92.zip
Abort analysis on type error
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/pattern/usefulness/issue-119493-type-error-ice.rs13
-rw-r--r--tests/ui/pattern/usefulness/issue-119493-type-error-ice.stderr30
2 files changed, 43 insertions, 0 deletions
diff --git a/tests/ui/pattern/usefulness/issue-119493-type-error-ice.rs b/tests/ui/pattern/usefulness/issue-119493-type-error-ice.rs
new file mode 100644
index 00000000000..6cf459eb82e
--- /dev/null
+++ b/tests/ui/pattern/usefulness/issue-119493-type-error-ice.rs
@@ -0,0 +1,13 @@
+fn main() {}
+
+fn foo() {
+    #[derive(Copy, Clone)]
+    struct Foo(NonExistent);
+    //~^ ERROR cannot find type
+    //~| ERROR cannot find type
+
+    type U = impl Copy;
+    //~^ ERROR `impl Trait` in type aliases is unstable
+    let foo: U = Foo(());
+    let Foo(()) = foo;
+}
diff --git a/tests/ui/pattern/usefulness/issue-119493-type-error-ice.stderr b/tests/ui/pattern/usefulness/issue-119493-type-error-ice.stderr
new file mode 100644
index 00000000000..6d74feb7a9f
--- /dev/null
+++ b/tests/ui/pattern/usefulness/issue-119493-type-error-ice.stderr
@@ -0,0 +1,30 @@
+error[E0412]: cannot find type `NonExistent` in this scope
+  --> $DIR/issue-119493-type-error-ice.rs:5:16
+   |
+LL |     struct Foo(NonExistent);
+   |                ^^^^^^^^^^^ not found in this scope
+
+error[E0412]: cannot find type `NonExistent` in this scope
+  --> $DIR/issue-119493-type-error-ice.rs:5:16
+   |
+LL |     struct Foo(NonExistent);
+   |                ^^^^^^^^^^^ not found in this scope
+   |
+help: you might be missing a type parameter
+   |
+LL |     struct Foo<NonExistent>(NonExistent);
+   |               +++++++++++++
+
+error[E0658]: `impl Trait` in type aliases is unstable
+  --> $DIR/issue-119493-type-error-ice.rs:9:14
+   |
+LL |     type U = impl Copy;
+   |              ^^^^^^^^^
+   |
+   = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+   = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0412, E0658.
+For more information about an error, try `rustc --explain E0412`.