2014-03-06 14:58:34 +00:00
|
|
|
// Tests that the use of uninitialized variable in assignment operator
|
|
|
|
// expression is detected.
|
|
|
|
|
|
|
|
pub fn main() {
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x += 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x -= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x *= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x /= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x %= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x ^= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x &= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x |= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x <<= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
|
2015-01-08 10:54:35 +00:00
|
|
|
let x: isize;
|
2022-06-21 18:57:45 +00:00
|
|
|
x >>= 1; //~ ERROR E0381
|
2014-03-06 14:58:34 +00:00
|
|
|
}
|