mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 15:54:15 +00:00
28 lines
534 B
Rust
28 lines
534 B
Rust
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
|
|
}
|