diff options
Diffstat (limited to 'tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs')
-rw-r--r-- | tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs b/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs new file mode 100644 index 000000000..c2aaae1c7 --- /dev/null +++ b/tests/ui/coercion/coerce-reborrow-imm-vec-arg.rs @@ -0,0 +1,19 @@ +// run-pass +#![allow(dead_code)] +// pretty-expanded FIXME #23616 + +fn sum(x: &[isize]) -> isize { + let mut sum = 0; + for y in x { sum += *y; } + return sum; +} + +fn sum_mut(y: &mut [isize]) -> isize { + sum(y) +} + +fn sum_imm(y: &[isize]) -> isize { + sum(y) +} + +pub fn main() {} |