From fc7fc0fae5079bc433a6e377b163a2a0757d65cd Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Wed, 17 Aug 2022 17:23:52 +0000 Subject: ty::Error does not match other types for region constraints --- src/test/ui/regions/outlives-with-missing.rs | 16 ++++++++++++++++ src/test/ui/regions/outlives-with-missing.stderr | 12 ++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/test/ui/regions/outlives-with-missing.rs create mode 100644 src/test/ui/regions/outlives-with-missing.stderr (limited to 'src') 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); + +impl HandlerWrapper { + 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 HandlerWrapper { + | - 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`. -- cgit 1.4.1-3-g733a5