summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/bound/on-structs-and-enums-in-fns.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/bound/on-structs-and-enums-in-fns.rs')
-rw-r--r--tests/ui/traits/bound/on-structs-and-enums-in-fns.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/traits/bound/on-structs-and-enums-in-fns.rs b/tests/ui/traits/bound/on-structs-and-enums-in-fns.rs
new file mode 100644
index 000000000..6a6fcf530
--- /dev/null
+++ b/tests/ui/traits/bound/on-structs-and-enums-in-fns.rs
@@ -0,0 +1,20 @@
+trait Trait {}
+
+struct Foo<T:Trait> {
+ x: T,
+}
+
+enum Bar<T:Trait> {
+ ABar(isize),
+ BBar(T),
+ CBar(usize),
+}
+
+fn explode(x: Foo<u32>) {}
+//~^ ERROR E0277
+
+fn kaboom(y: Bar<f32>) {}
+//~^ ERROR E0277
+
+fn main() {
+}