diff options
Diffstat (limited to 'tests/ui/wf/wf-in-fn-type-arg.rs')
-rw-r--r-- | tests/ui/wf/wf-in-fn-type-arg.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/wf/wf-in-fn-type-arg.rs b/tests/ui/wf/wf-in-fn-type-arg.rs new file mode 100644 index 000000000..2917a8aa9 --- /dev/null +++ b/tests/ui/wf/wf-in-fn-type-arg.rs @@ -0,0 +1,12 @@ +// Check that we enforce WF conditions also for types in fns. + +struct MustBeCopy<T:Copy> { + t: T +} + +struct Bar<T> { + // needs T: Copy + x: fn(MustBeCopy<T>) //~ ERROR E0277 +} + +fn main() { } |