diff options
Diffstat (limited to 'tests/ui/impl-trait/printing-binder.rs')
-rw-r--r-- | tests/ui/impl-trait/printing-binder.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/printing-binder.rs b/tests/ui/impl-trait/printing-binder.rs new file mode 100644 index 000000000..273b5dcdb --- /dev/null +++ b/tests/ui/impl-trait/printing-binder.rs @@ -0,0 +1,14 @@ +trait Trait<'a> {} +impl<T> Trait<'_> for T {} +fn whatever() -> impl for<'a> Trait<'a> + for<'b> Trait<'b> {} + +fn whatever2() -> impl for<'c> Fn(&'c ()) { + |_: &()| {} +} + +fn main() { + let x: u32 = whatever(); + //~^ ERROR mismatched types + let x2: u32 = whatever2(); + //~^ ERROR mismatched types +} |