tests: fix fallout from changed error messages.
This commit is contained in:
parent
03295a715f
commit
08967c7a7f
5 changed files with 11 additions and 10 deletions
|
@ -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() {
|
||||
|
|
|
@ -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() {}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,8 +15,8 @@ use std::cell::RefCell;
|
|||
// Regression test for issue 7364
|
||||
static boxed: Box<RefCell<isize>> = 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() { }
|
||||
|
|
|
@ -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() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue