diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/illegal-sized-bound/mutability-mismatch-arg.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/illegal-sized-bound/mutability-mismatch-arg.rs b/tests/ui/illegal-sized-bound/mutability-mismatch-arg.rs new file mode 100644 index 000000000..3b02c5a5a --- /dev/null +++ b/tests/ui/illegal-sized-bound/mutability-mismatch-arg.rs @@ -0,0 +1,9 @@ +// run-rustfix +fn test(t: &dyn Iterator<Item=&u64>) -> u64 { + *t.min().unwrap() //~ ERROR the `min` method cannot be invoked on +} + +fn main() { + let array = [0u64]; + test(&mut array.iter()); +} |