From a2cd95fd9ea3eb698dc9f8ae7dd29321e5345e96 Mon Sep 17 00:00:00 2001 From: Alexander Regueiro Date: Wed, 30 May 2018 19:27:45 +0100 Subject: Fixed bug with miri const evaluation where allocation is recursively borrowed. --- .../compile-fail/auxiliary/pub_static_array.rs | 11 --------- src/test/compile-fail/issue-28324.rs | 1 + src/test/compile-fail/static-array-across-crate.rs | 27 ---------------------- 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 src/test/compile-fail/auxiliary/pub_static_array.rs delete mode 100644 src/test/compile-fail/static-array-across-crate.rs (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/auxiliary/pub_static_array.rs b/src/test/compile-fail/auxiliary/pub_static_array.rs deleted file mode 100644 index 7248d0e543b..00000000000 --- a/src/test/compile-fail/auxiliary/pub_static_array.rs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2014 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -pub static ARRAY: [u8; 1] = [1]; diff --git a/src/test/compile-fail/issue-28324.rs b/src/test/compile-fail/issue-28324.rs index 4179048b461..369f919471c 100644 --- a/src/test/compile-fail/issue-28324.rs +++ b/src/test/compile-fail/issue-28324.rs @@ -16,5 +16,6 @@ extern { pub static BAZ: u32 = *&error_message_count; //~^ ERROR constant evaluation error +//~| tried to read foreign (extern) static fn main() {} diff --git a/src/test/compile-fail/static-array-across-crate.rs b/src/test/compile-fail/static-array-across-crate.rs deleted file mode 100644 index d101432f6d1..00000000000 --- a/src/test/compile-fail/static-array-across-crate.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2015 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:pub_static_array.rs - -extern crate pub_static_array as array; - -use array::ARRAY; - -static X: &'static u8 = &ARRAY[0]; -//~^ ERROR: cannot refer to the interior of another static, use a constant - -static Y: &'static u8 = &(&ARRAY)[0]; -//~^ ERROR: cannot refer to the interior of another static, use a constant - -static Z: u8 = (&ARRAY)[0]; -//~^ ERROR: cannot refer to the interior of another static, use a constant -//~^^ ERROR: cannot refer to other statics by value - -pub fn main() {} -- cgit 1.4.1-3-g733a5