2017-11-17 16:20:28 -06:00
|
|
|
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2018-09-04 05:05:53 -05:00
|
|
|
// run-pass
|
2017-11-17 16:20:28 -06:00
|
|
|
// Test taken from #45641 (https://github.com/rust-lang/rust/issues/45641)
|
|
|
|
|
|
|
|
// revisions: ast mir
|
2017-11-19 16:37:59 -06:00
|
|
|
//[mir]compile-flags: -Z borrowck=mir
|
2017-11-17 16:20:28 -06:00
|
|
|
|
|
|
|
static mut Y: u32 = 0;
|
|
|
|
|
|
|
|
unsafe fn should_ok() {
|
|
|
|
Y = 1;
|
|
|
|
}
|
|
|
|
|
2017-11-19 16:37:59 -06:00
|
|
|
fn main() {}
|