diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-35668.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-35668.rs b/src/test/ui/issues/issue-35668.rs new file mode 100644 index 000000000..c970163fc --- /dev/null +++ b/src/test/ui/issues/issue-35668.rs @@ -0,0 +1,12 @@ +fn func<'a, T>(a: &'a [T]) -> impl Iterator<Item=&'a T> { + a.iter().map(|a| a*a) + //~^ ERROR cannot multiply `&T` by `&T` +} + +fn main() { + let a = (0..30).collect::<Vec<_>>(); + + for k in func(&a) { + println!("{}", k); + } +} |