rust/src/test/ui/borrowck/borrowck-init-in-fru.rs
2019-09-06 03:46:08 +01:00

13 lines
236 B
Rust

#[derive(Clone)]
struct Point {
x: isize,
y: isize,
}
fn main() {
let mut origin: Point;
origin = Point { x: 10, ..origin };
//~^ ERROR use of possibly-uninitialized variable: `origin` [E0381]
origin.clone();
}