diff options
Diffstat (limited to 'tests/ui/borrowck/borrowck-init-in-fru.rs')
-rw-r--r-- | tests/ui/borrowck/borrowck-init-in-fru.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-init-in-fru.rs b/tests/ui/borrowck/borrowck-init-in-fru.rs new file mode 100644 index 000000000..c07957ab1 --- /dev/null +++ b/tests/ui/borrowck/borrowck-init-in-fru.rs @@ -0,0 +1,12 @@ +#[derive(Clone)] +struct Point { + x: isize, + y: isize, +} + +fn main() { + let mut origin: Point; + origin = Point { x: 10, ..origin }; + //~^ ERROR E0381 + origin.clone(); +} |