]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/borrowck-partial-reinit-4.rs
New upstream version 1.39.0+dfsg1
[rustc.git] / src / test / ui / borrowck / borrowck-partial-reinit-4.rs
CommitLineData
85aaf69f 1struct Test;
223e47cc 2
85aaf69f 3struct Test2(Option<Test>);
223e47cc 4
85aaf69f
SL
5impl Drop for Test {
6 fn drop(&mut self) {
7 println!("dropping!");
8 }
9}
10
11impl Drop for Test2 {
12 fn drop(&mut self) {}
13}
14
15fn stuff() {
16 let mut x : (Test2, Test2);
17 (x.0).0 = Some(Test);
e1599b0c 18 //~^ ERROR assign of possibly-uninitialized variable: `x.0`
85aaf69f 19}
223e47cc
LB
20
21fn main() {
85aaf69f 22 stuff()
223e47cc 23}