about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/regions/outlives-with-missing.rs16
-rw-r--r--src/test/ui/regions/outlives-with-missing.stderr12
2 files changed, 28 insertions, 0 deletions
diff --git a/src/test/ui/regions/outlives-with-missing.rs b/src/test/ui/regions/outlives-with-missing.rs
new file mode 100644
index 00000000000..29d89718b58
--- /dev/null
+++ b/src/test/ui/regions/outlives-with-missing.rs
@@ -0,0 +1,16 @@
+trait HandlerFamily {
+    type Target;
+}
+
+struct HandlerWrapper<H: HandlerFamily>(H);
+
+impl<H: HandlerFamily> HandlerWrapper<H> {
+    pub fn set_handler(&self, handler: &H::Target)
+    where
+        T: Send + Sync + 'static,
+        //~^ ERROR cannot find type `T` in this scope
+    {
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/regions/outlives-with-missing.stderr b/src/test/ui/regions/outlives-with-missing.stderr
new file mode 100644
index 00000000000..e204c918724
--- /dev/null
+++ b/src/test/ui/regions/outlives-with-missing.stderr
@@ -0,0 +1,12 @@
+error[E0412]: cannot find type `T` in this scope
+  --> $DIR/outlives-with-missing.rs:10:9
+   |
+LL | impl<H: HandlerFamily> HandlerWrapper<H> {
+   |      - similarly named type parameter `H` defined here
+...
+LL |         T: Send + Sync + 'static,
+   |         ^ help: a type parameter with a similar name exists: `H`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.