1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // this tests move up progration, which is not yet implemented
12 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
13 // file at the top-level directory of this distribution and at
14 // http://rust-lang.org/COPYRIGHT.
16 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
17 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
18 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
19 // option. This file may not be copied, modified, or distributed
20 // except according to those terms.
22 // Check codegen for assignments (`a = b`) where the left-hand-side is
23 // not yet initialized. Assignments tend to be absent in simple code,
24 // so subtle breakage in them can leave a quite hard-to-find trail of
27 // ignore-tidy-linelength
33 // Since boolean does not require drop, this can be a simple
37 let drop_x : Option<Box<u32>> = None;
40 // Since the type of `drop_y` has drop, we generate a `replace`
46 // START rustc.main.SimplifyCfg-initial.after.mir
50 // FakeRead(ForLet, _1);
57 // _4 = std::option::Option<std::boxed::Box<u32>>::None;
58 // AscribeUserType(_4, o, Canonical { variables: [], value: std::option::Option<std::boxed::Box<u32>> });
59 // FakeRead(ForLet, _4);
63 // replace(_5 <- move _6) -> [return: bb2, unwind: bb5];
67 // drop(_6) -> [return: bb6, unwind: bb4];
73 // END rustc.main.SimplifyCfg-initial.after.mir