Skip to content

Commit 51fbd55

Browse files
Bless tests
1 parent b400871 commit 51fbd55

21 files changed

+71
-242
lines changed

src/test/ui/check-static-values-constraints.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ struct MyOwned;
7878

7979
static STATIC11: Box<MyOwned> = box MyOwned;
8080
//~^ ERROR allocations are not allowed in statics
81-
//~| ERROR static contains unimplemented expression type
8281

8382
static mut STATIC12: UnsafeStruct = UnsafeStruct;
8483

@@ -93,28 +92,22 @@ static mut STATIC14: SafeStruct = SafeStruct {
9392

9493
static STATIC15: &'static [Box<MyOwned>] = &[
9594
box MyOwned, //~ ERROR allocations are not allowed in statics
96-
//~| ERROR contains unimplemented expression
9795
box MyOwned, //~ ERROR allocations are not allowed in statics
98-
//~| ERROR contains unimplemented expression
9996
];
10097

10198
static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) = (
10299
&box MyOwned, //~ ERROR allocations are not allowed in statics
103-
//~| ERROR contains unimplemented expression
104100
&box MyOwned, //~ ERROR allocations are not allowed in statics
105-
//~| ERROR contains unimplemented expression
106101
);
107102

108103
static mut STATIC17: SafeEnum = SafeEnum::Variant1;
109104

110105
static STATIC19: Box<isize> =
111106
box 3;
112107
//~^ ERROR allocations are not allowed in statics
113-
//~| ERROR contains unimplemented expression
114108

115109
pub fn main() {
116110
let y = { static x: Box<isize> = box 3; x };
117111
//~^ ERROR allocations are not allowed in statics
118112
//~| ERROR cannot move out of static item
119-
//~| ERROR contains unimplemented expression
120113
}

src/test/ui/check-static-values-constraints.stderr

Lines changed: 10 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -15,92 +15,44 @@ error[E0010]: allocations are not allowed in statics
1515
LL | static STATIC11: Box<MyOwned> = box MyOwned;
1616
| ^^^^^^^^^^^ allocation not allowed in statics
1717

18-
error[E0019]: static contains unimplemented expression type
19-
--> $DIR/check-static-values-constraints.rs:79:37
20-
|
21-
LL | static STATIC11: Box<MyOwned> = box MyOwned;
22-
| ^^^^^^^
23-
|
24-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
25-
2618
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
27-
--> $DIR/check-static-values-constraints.rs:90:32
19+
--> $DIR/check-static-values-constraints.rs:89:32
2820
|
2921
LL | field2: SafeEnum::Variant4("str".to_string())
3022
| ^^^^^^^^^^^^^^^^^
3123

3224
error[E0010]: allocations are not allowed in statics
33-
--> $DIR/check-static-values-constraints.rs:95:5
25+
--> $DIR/check-static-values-constraints.rs:94:5
3426
|
3527
LL | box MyOwned,
3628
| ^^^^^^^^^^^ allocation not allowed in statics
3729

38-
error[E0019]: static contains unimplemented expression type
39-
--> $DIR/check-static-values-constraints.rs:95:9
40-
|
41-
LL | box MyOwned,
42-
| ^^^^^^^
43-
|
44-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
45-
4630
error[E0010]: allocations are not allowed in statics
47-
--> $DIR/check-static-values-constraints.rs:97:5
31+
--> $DIR/check-static-values-constraints.rs:95:5
4832
|
4933
LL | box MyOwned,
5034
| ^^^^^^^^^^^ allocation not allowed in statics
5135

52-
error[E0019]: static contains unimplemented expression type
53-
--> $DIR/check-static-values-constraints.rs:97:9
54-
|
55-
LL | box MyOwned,
56-
| ^^^^^^^
57-
|
58-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
59-
6036
error[E0010]: allocations are not allowed in statics
61-
--> $DIR/check-static-values-constraints.rs:102:6
37+
--> $DIR/check-static-values-constraints.rs:99:6
6238
|
6339
LL | &box MyOwned,
6440
| ^^^^^^^^^^^ allocation not allowed in statics
6541

66-
error[E0019]: static contains unimplemented expression type
67-
--> $DIR/check-static-values-constraints.rs:102:10
68-
|
69-
LL | &box MyOwned,
70-
| ^^^^^^^
71-
|
72-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
73-
7442
error[E0010]: allocations are not allowed in statics
75-
--> $DIR/check-static-values-constraints.rs:104:6
43+
--> $DIR/check-static-values-constraints.rs:100:6
7644
|
7745
LL | &box MyOwned,
7846
| ^^^^^^^^^^^ allocation not allowed in statics
7947

80-
error[E0019]: static contains unimplemented expression type
81-
--> $DIR/check-static-values-constraints.rs:104:10
82-
|
83-
LL | &box MyOwned,
84-
| ^^^^^^^
85-
|
86-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
87-
8848
error[E0010]: allocations are not allowed in statics
89-
--> $DIR/check-static-values-constraints.rs:111:5
49+
--> $DIR/check-static-values-constraints.rs:106:5
9050
|
9151
LL | box 3;
9252
| ^^^^^ allocation not allowed in statics
9353

94-
error[E0019]: static contains unimplemented expression type
95-
--> $DIR/check-static-values-constraints.rs:111:9
96-
|
97-
LL | box 3;
98-
| ^
99-
|
100-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
101-
10254
error[E0507]: cannot move out of static item `x`
103-
--> $DIR/check-static-values-constraints.rs:116:45
55+
--> $DIR/check-static-values-constraints.rs:110:45
10456
|
10557
LL | let y = { static x: Box<isize> = box 3; x };
10658
| ^
@@ -109,20 +61,12 @@ LL | let y = { static x: Box<isize> = box 3; x };
10961
| help: consider borrowing here: `&x`
11062

11163
error[E0010]: allocations are not allowed in statics
112-
--> $DIR/check-static-values-constraints.rs:116:38
64+
--> $DIR/check-static-values-constraints.rs:110:38
11365
|
11466
LL | let y = { static x: Box<isize> = box 3; x };
11567
| ^^^^^ allocation not allowed in statics
11668

117-
error[E0019]: static contains unimplemented expression type
118-
--> $DIR/check-static-values-constraints.rs:116:42
119-
|
120-
LL | let y = { static x: Box<isize> = box 3; x };
121-
| ^
122-
|
123-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
124-
125-
error: aborting due to 17 previous errors
69+
error: aborting due to 10 previous errors
12670

127-
Some errors have detailed explanations: E0010, E0015, E0019, E0493, E0507.
71+
Some errors have detailed explanations: E0010, E0015, E0493, E0507.
12872
For more information about an error, try `rustc --explain E0010`.

src/test/ui/const-suggest-feature.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ const WRITE: () = unsafe {
22
*std::ptr::null_mut() = 0;
33
//~^ ERROR dereferencing raw pointers in constants is unstable
44
//~| HELP add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
5-
//~| ERROR constant contains unimplemented expression type
6-
//~| HELP add `#![feature(const_mut_refs)]` to the crate attributes to enable
75
};
86

97
fn main() {}

src/test/ui/const-suggest-feature.stderr

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,6 @@ LL | *std::ptr::null_mut() = 0;
77
= note: see issue #51911 <https://github.com/rust-lang/rust/issues/51911> for more information
88
= help: add `#![feature(const_raw_ptr_deref)]` to the crate attributes to enable
99

10-
error[E0019]: constant contains unimplemented expression type
11-
--> $DIR/const-suggest-feature.rs:2:5
12-
|
13-
LL | *std::ptr::null_mut() = 0;
14-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
15-
|
16-
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
17-
18-
error: aborting due to 2 previous errors
10+
error: aborting due to previous error
1911

20-
Some errors have detailed explanations: E0019, E0658.
21-
For more information about an error, try `rustc --explain E0019`.
12+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/consts/const-extern-fn/const-extern-fn-min-const-fn.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0658]: function pointers cannot appear in constant functions
2-
--> $DIR/const-extern-fn-min-const-fn.rs:4:41
2+
--> $DIR/const-extern-fn-min-const-fn.rs:4:48
33
|
44
LL | const unsafe extern "C" fn closure() -> fn() { || {} }
5-
| ^^^^
5+
| ^^^^^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
88
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable

src/test/ui/consts/min_const_fn/cast_errors.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error[E0658]: function pointers cannot appear in constant functions
2-
--> $DIR/cast_errors.rs:4:23
2+
--> $DIR/cast_errors.rs:4:30
33
|
44
LL | const fn closure() -> fn() { || {} }
5-
| ^^^^
5+
| ^^^^^
66
|
77
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
88
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
@@ -17,10 +17,10 @@ LL | (|| {}) as fn();
1717
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
1818

1919
error[E0658]: function pointers cannot appear in constant functions
20-
--> $DIR/cast_errors.rs:10:28
20+
--> $DIR/cast_errors.rs:10:16
2121
|
2222
LL | const fn reify(f: fn()) -> unsafe fn() { f }
23-
| ^^^^^^^^^^^
23+
| ^
2424
|
2525
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
2626
= help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable

src/test/ui/consts/min_const_fn/min_const_fn.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ impl<T> Foo<T> {
4040
//~^ mutable references
4141
//~| mutable references
4242
//~| mutable references
43-
//~| mutable references
4443
}
4544
impl<'a, T> Foo<T> {
4645
const fn new_lt(t: T) -> Self { Foo(t) }
@@ -50,7 +49,6 @@ impl<'a, T> Foo<T> {
5049
//~^ mutable references
5150
//~| mutable references
5251
//~| mutable references
53-
//~| mutable references
5452
}
5553
impl<T: Sized> Foo<T> {
5654
const fn new_s(t: T) -> Self { Foo(t) }
@@ -60,15 +58,13 @@ impl<T: Sized> Foo<T> {
6058
//~^ mutable references
6159
//~| mutable references
6260
//~| mutable references
63-
//~| mutable references
6461
}
6562
impl<T: ?Sized> Foo<T> {
6663
const fn get_sq(&self) -> &T { &self.0 }
6764
const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
6865
//~^ mutable references
6966
//~| mutable references
7067
//~| mutable references
71-
//~| mutable references
7268
}
7369

7470

0 commit comments

Comments
 (0)