diff --git a/src/test/compile-fail/const-block-non-item-statement.rs b/src/test/compile-fail/const-block-non-item-statement.rs index 62e8fccbda05..f66c68541b18 100644 --- a/src/test/compile-fail/const-block-non-item-statement.rs +++ b/src/test/compile-fail/const-block-non-item-statement.rs @@ -8,18 +8,18 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -static A: usize = { 1us; 2 }; +const A: usize = { 1us; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions -static B: usize = { { } 2 }; +const B: usize = { { } 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions macro_rules! foo { () => (()) //~ ERROR: blocks in constants are limited to items and tail expressions } -static C: usize = { foo!(); 2 }; +const C: usize = { foo!(); 2 }; -static D: usize = { let x = 4us; 2 }; +const D: usize = { let x = 4us; 2 }; //~^ ERROR: blocks in constants are limited to items and tail expressions pub fn main() { diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index a6b73dcc19ce..6d2cfcab04e3 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -20,6 +20,7 @@ mod Y { static foo: *const Y::X = Y::foo(Y::x as *const Y::X); //~^ ERROR cannot refer to other statics by value -//~| ERROR: the trait `core::marker::Sync` is not implemented for the type +//~| ERROR the trait `core::marker::Sync` is not implemented for the type +//~| ERROR function calls in statics are limited to struct and enum constructors fn main() {} diff --git a/src/test/compile-fail/issue-18118.rs b/src/test/compile-fail/issue-18118.rs index 53df24d5b00c..c5370879cc2d 100644 --- a/src/test/compile-fail/issue-18118.rs +++ b/src/test/compile-fail/issue-18118.rs @@ -9,7 +9,7 @@ // except according to those terms. pub fn main() { - static z: &'static isize = { + const z: &'static isize = { let p = 3; //~^ ERROR blocks in constants are limited to items and tail expressions &p diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index 8744afe23392..6a36b2f84bfc 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -15,8 +15,8 @@ use std::cell::RefCell; // Regression test for issue 7364 static boxed: Box> = box RefCell::new(0); //~^ ERROR allocations are not allowed in statics -//~| ERROR: the trait `core::marker::Sync` is not implemented for the type -//~| ERROR: the trait `core::marker::Sync` is not implemented for the type -//~^^^^^ ERROR function calls in constants are limited to struct and enum constructors +//~| ERROR the trait `core::marker::Sync` is not implemented for the type +//~| ERROR the trait `core::marker::Sync` is not implemented for the type +//~| ERROR function calls in statics are limited to struct and enum constructors fn main() { } diff --git a/src/test/compile-fail/static-vec-repeat-not-constant.rs b/src/test/compile-fail/static-vec-repeat-not-constant.rs index 7cb7615526a8..7a957564587f 100644 --- a/src/test/compile-fail/static-vec-repeat-not-constant.rs +++ b/src/test/compile-fail/static-vec-repeat-not-constant.rs @@ -11,6 +11,6 @@ fn foo() -> isize { 23 } static a: [isize; 2] = [foo(); 2]; -//~^ ERROR: function calls in constants are limited to struct and enum constructors +//~^ ERROR: function calls in statics are limited to struct and enum constructors fn main() {}