Skip to content

Commit a26b82c

Browse files
committed
tests: fix fallout from changed error messages.
1 parent 27f22b8 commit a26b82c

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

src/test/compile-fail/const-block-non-item-statement.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
static A: usize = { 1us; 2 };
11+
const A: usize = { 1us; 2 };
1212
//~^ ERROR: blocks in constants are limited to items and tail expressions
1313

14-
static B: usize = { { } 2 };
14+
const B: usize = { { } 2 };
1515
//~^ ERROR: blocks in constants are limited to items and tail expressions
1616

1717
macro_rules! foo {
1818
() => (()) //~ ERROR: blocks in constants are limited to items and tail expressions
1919
}
20-
static C: usize = { foo!(); 2 };
20+
const C: usize = { foo!(); 2 };
2121

22-
static D: usize = { let x = 4us; 2 };
22+
const D: usize = { let x = 4us; 2 };
2323
//~^ ERROR: blocks in constants are limited to items and tail expressions
2424

2525
pub fn main() {

src/test/compile-fail/issue-16538.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ mod Y {
2020

2121
static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
2222
//~^ ERROR cannot refer to other statics by value
23-
//~| ERROR: the trait `core::marker::Sync` is not implemented for the type
23+
//~| ERROR the trait `core::marker::Sync` is not implemented for the type
24+
//~| ERROR function calls in statics are limited to struct and enum constructors
2425

2526
fn main() {}

src/test/compile-fail/issue-18118.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
pub fn main() {
12-
static z: &'static isize = {
12+
const z: &'static isize = {
1313
let p = 3;
1414
//~^ ERROR blocks in constants are limited to items and tail expressions
1515
&p

src/test/compile-fail/issue-7364.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use std::cell::RefCell;
1515
// Regresion test for issue 7364
1616
static boxed: Box<RefCell<isize>> = box RefCell::new(0);
1717
//~^ ERROR allocations are not allowed in statics
18-
//~| ERROR: the trait `core::marker::Sync` is not implemented for the type
19-
//~| ERROR: the trait `core::marker::Sync` is not implemented for the type
20-
//~^^^^^ ERROR function calls in constants are limited to struct and enum constructors
18+
//~| ERROR the trait `core::marker::Sync` is not implemented for the type
19+
//~| ERROR the trait `core::marker::Sync` is not implemented for the type
20+
//~| ERROR function calls in statics are limited to struct and enum constructors
2121

2222
fn main() { }

src/test/compile-fail/static-vec-repeat-not-constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
fn foo() -> isize { 23 }
1212

1313
static a: [isize; 2] = [foo(); 2];
14-
//~^ ERROR: function calls in constants are limited to struct and enum constructors
14+
//~^ ERROR: function calls in statics are limited to struct and enum constructors
1515

1616
fn main() {}

0 commit comments

Comments
 (0)