diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/suggestions/issue-109991.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/ui/suggestions/issue-109991.rs b/tests/ui/suggestions/issue-109991.rs new file mode 100644 index 000000000..918451cb8 --- /dev/null +++ b/tests/ui/suggestions/issue-109991.rs @@ -0,0 +1,27 @@ +struct S { + a: usize, + b: usize, +} + +fn main() { + let a: usize; + let b: usize; + let c: usize; + + (c) = (&123); //~ ERROR mismatched types + (a, b) = (123, &mut 123); //~ ERROR mismatched types + + let x: String; + (x,) = (1,); //~ ERROR mismatched types + + let x: i32; + [x] = [&1]; //~ ERROR mismatched types + + let x: &i32; + [x] = [1]; //~ ERROR mismatched types + + let x = (1, &mut 2); + (a, b) = x; //~ ERROR mismatched types + + S { a, b } = S { a: 1, b: &mut 2 }; //~ ERROR mismatched types +} |