summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/universal_wrong_bounds.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/impl-trait/universal_wrong_bounds.rs')
-rw-r--r--src/test/ui/impl-trait/universal_wrong_bounds.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.rs b/src/test/ui/impl-trait/universal_wrong_bounds.rs
new file mode 100644
index 000000000..2182506c7
--- /dev/null
+++ b/src/test/ui/impl-trait/universal_wrong_bounds.rs
@@ -0,0 +1,13 @@
+use std::fmt::Display;
+
+fn foo(f: impl Display + Clone) -> String {
+ wants_debug(f);
+ wants_display(f);
+ wants_clone(f);
+}
+
+fn wants_debug(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug`
+fn wants_display(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug`
+fn wants_clone(g: impl Clone) { }
+
+fn main() {}