diff options
| author | Alexander Regueiro <alexreg@me.com> | 2018-05-27 17:07:23 +0100 |
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2018-06-30 23:52:33 +0100 |
| commit | 13931762e9832d215bb6ffcfbe4cbd126050b91c (patch) | |
| tree | f6ea417f7e3e17abd86ba5752d08a46304d29163 /src/test/compile-fail | |
| parent | 74c89b023020e4c6b04acfc877a115c95ec7747b (diff) | |
| download | rust-13931762e9832d215bb6ffcfbe4cbd126050b91c.tar.gz rust-13931762e9832d215bb6ffcfbe4cbd126050b91c.zip | |
Loosened rules involving statics mentioning other statics.
Updated tests accordingly.
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/issue-16538.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-17718-borrow-interior.rs | 25 |
2 files changed, 0 insertions, 26 deletions
diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index 7df445c676c..cc652119377 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -22,7 +22,6 @@ mod Y { static foo: *const Y::X = Y::foo(Y::x as *const Y::X); //~^ ERROR `*const usize` cannot be shared between threads safely [E0277] -//~| ERROR cannot refer to other statics by value, use the address-of operator or a constant instead //~| ERROR E0015 fn main() {} diff --git a/src/test/compile-fail/issue-17718-borrow-interior.rs b/src/test/compile-fail/issue-17718-borrow-interior.rs deleted file mode 100644 index 31352c57f1b..00000000000 --- a/src/test/compile-fail/issue-17718-borrow-interior.rs +++ /dev/null @@ -1,25 +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 <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. - -struct S { a: usize } -static A: S = S { a: 3 }; -static B: &'static usize = &A.a; -//~^ ERROR: cannot refer to the interior of another static -static C: &'static usize = &(A.a); -//~^ ERROR: cannot refer to the interior of another static - -static D: [usize; 1] = [1]; -static E: usize = D[0]; -//~^ ERROR: cannot refer to the interior of another static -//~^^ ERROR: cannot refer to other statics by value -static F: &'static usize = &D[0]; -//~^ ERROR: cannot refer to the interior of another static - -fn main() {} |
