From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/trait-bounds/mismatch-fn-trait.rs | 28 +++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/ui/trait-bounds/mismatch-fn-trait.rs (limited to 'src/test/ui/trait-bounds/mismatch-fn-trait.rs') diff --git a/src/test/ui/trait-bounds/mismatch-fn-trait.rs b/src/test/ui/trait-bounds/mismatch-fn-trait.rs new file mode 100644 index 000000000..0ed64043a --- /dev/null +++ b/src/test/ui/trait-bounds/mismatch-fn-trait.rs @@ -0,0 +1,28 @@ +fn take(_f: impl FnMut(i32)) {} + +fn test1(f: impl FnMut(u32)) { + take(f) + //~^ ERROR [E0277] +} + +fn test2(f: impl FnMut(i32, i32)) { + take(f) + //~^ ERROR [E0277] +} + +fn test3(f: impl FnMut()) { + take(f) + //~^ ERROR [E0277] +} + +fn test4(f: impl FnOnce(i32)) { + take(f) + //~^ ERROR [E0277] +} + +fn test5(f: impl FnOnce(u32)) { + take(f) + //~^ ERROR [E0277] +} + +fn main() {} -- cgit v1.2.3