mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
35 lines
588 B
Rust
35 lines
588 B
Rust
// Tests that the use of uninitialized variable in assignment operator
|
|
// expression is detected.
|
|
|
|
pub fn main() {
|
|
let x: isize;
|
|
x += 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x -= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x *= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x /= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x %= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x ^= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x &= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x |= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x <<= 1; //~ ERROR E0381
|
|
|
|
let x: isize;
|
|
x >>= 1; //~ ERROR E0381
|
|
}
|