about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorlightning1141 <lightning1141@gmail.com>2022-02-26 11:55:07 +0800
committerlightning1141 <lightning1141@gmail.com>2022-03-25 02:53:30 +0800
commit85e67b9a5917bc82bdba0aaa3a18595904cee629 (patch)
treee6e53b1afb7cad5a3c825668afcb96cd98cf503d /src/test
parent37b55c8a0cafdb60b9168da34f904acc70157df8 (diff)
downloadrust-85e67b9a5917bc82bdba0aaa3a18595904cee629.tar.gz
rust-85e67b9a5917bc82bdba0aaa3a18595904cee629.zip
Fix ice when error reporting recursion errors
Fixes: #90319, #92148, #93955
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/typeck/issue-90319.rs17
-rw-r--r--src/test/ui/typeck/issue-90319.stderr9
2 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/typeck/issue-90319.rs b/src/test/ui/typeck/issue-90319.rs
new file mode 100644
index 00000000000..57e6ac7cf34
--- /dev/null
+++ b/src/test/ui/typeck/issue-90319.rs
@@ -0,0 +1,17 @@
+struct Wrapper<T>(T);
+
+trait Trait {
+    fn method(&self) {}
+}
+
+impl<'a, T> Trait for Wrapper<&'a T> where Wrapper<T>: Trait {}
+
+fn get<T>() -> T {
+    unimplemented!()
+}
+
+fn main() {
+    let thing = get::<Thing>();//~ERROR cannot find type `Thing` in this scope [E0412]
+    let wrapper = Wrapper(thing);
+    Trait::method(&wrapper);
+}
diff --git a/src/test/ui/typeck/issue-90319.stderr b/src/test/ui/typeck/issue-90319.stderr
new file mode 100644
index 00000000000..61549dd701e
--- /dev/null
+++ b/src/test/ui/typeck/issue-90319.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Thing` in this scope
+  --> $DIR/issue-90319.rs:14:23
+   |
+LL |     let thing = get::<Thing>();
+   |                       ^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.