Skip to content

Commit 191d3b7

Browse files
committed
bless tests again
1 parent 5ead742 commit 191d3b7

15 files changed

+64
-104
lines changed

Diff for: src/test/ui/const-generics/issue-93647.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
struct X<const N: usize = {
22
(||1usize)()
3-
//~^ ERROR cannot call
3+
//~^ ERROR the trait bound
44
}>;
55

66
fn main() {}

Diff for: src/test/ui/const-generics/issue-93647.stderr

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
error[E0015]: cannot call non-const closure in constants
1+
error[E0277]: the trait bound `[closure@$DIR/issue-93647.rs:2:6: 2:8]: Fn<()>` is not satisfied
22
--> $DIR/issue-93647.rs:2:5
33
|
44
LL | (||1usize)()
5-
| ^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
6+
|
7+
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
8+
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-93647.rs:2:6: 2:8]`, but that implementation is not `const`
9+
--> $DIR/issue-93647.rs:2:5
610
|
7-
= note: closures need an RFC before allowed to be called in constants
8-
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
11+
LL | (||1usize)()
12+
| ^^^^^^^^^^^^
13+
= note: wrap the `[closure@$DIR/issue-93647.rs:2:6: 2:8]` in a closure with no arguments: `|| { /* code */ }`
914

1015
error: aborting due to previous error
1116

12-
For more information about this error, try `rustc --explain E0015`.
17+
For more information about this error, try `rustc --explain E0277`.

Diff for: src/test/ui/consts/issue-28113.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const X: u8 =
44
|| -> u8 { 5 }()
5-
//~^ ERROR cannot call non-const closure
5+
//~^ ERROR the trait bound
66
;
77

88
fn main() {}

Diff for: src/test/ui/consts/issue-28113.stderr

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
error[E0015]: cannot call non-const closure in constants
1+
error[E0277]: the trait bound `[closure@$DIR/issue-28113.rs:4:5: 4:13]: Fn<()>` is not satisfied
22
--> $DIR/issue-28113.rs:4:5
33
|
44
LL | || -> u8 { 5 }()
5-
| ^^^^^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
6+
|
7+
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
8+
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-28113.rs:4:5: 4:13]`, but that implementation is not `const`
9+
--> $DIR/issue-28113.rs:4:5
610
|
7-
= note: closures need an RFC before allowed to be called in constants
8-
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
11+
LL | || -> u8 { 5 }()
12+
| ^^^^^^^^^^^^^^^^
13+
= note: wrap the `[closure@$DIR/issue-28113.rs:4:5: 4:13]` in a closure with no arguments: `|| { /* code */ }`
914

1015
error: aborting due to previous error
1116

12-
For more information about this error, try `rustc --explain E0015`.
17+
For more information about this error, try `rustc --explain E0277`.

Diff for: src/test/ui/consts/issue-56164.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
const fn foo() { (||{})() }
2-
//~^ ERROR cannot call non-const closure
3-
//~| ERROR erroneous constant used [const_err]
4-
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
2+
//~^ ERROR the trait bound
53

64
const fn bad(input: fn()) {
75
input()
8-
//~^ ERROR function pointer
96
}
107

118
fn main() {

Diff for: src/test/ui/consts/issue-56164.stderr

+8-30
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,17 @@
1-
error[E0015]: cannot call non-const closure in constant functions
1+
error[E0277]: the trait bound `[closure@$DIR/issue-56164.rs:1:19: 1:21]: Fn<()>` is not satisfied
22
--> $DIR/issue-56164.rs:1:18
33
|
44
LL | const fn foo() { (||{})() }
5-
| ^^^^^^^^
6-
|
7-
= note: closures need an RFC before allowed to be called in constant functions
8-
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
9-
10-
error: function pointer calls are not allowed in constant functions
11-
--> $DIR/issue-56164.rs:7:5
5+
| ^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
126
|
13-
LL | input()
14-
| ^^^^^^^
15-
16-
error: erroneous constant used
7+
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
8+
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-56164.rs:1:19: 1:21]`, but that implementation is not `const`
179
--> $DIR/issue-56164.rs:1:18
1810
|
1911
LL | const fn foo() { (||{})() }
20-
| ^^^^^^ referenced constant has errors
21-
|
22-
= note: `#[deny(const_err)]` on by default
23-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
24-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
25-
26-
error: aborting due to 3 previous errors
12+
| ^^^^^^^^
13+
= note: wrap the `[closure@$DIR/issue-56164.rs:1:19: 1:21]` in a closure with no arguments: `|| { /* code */ }`
2714

28-
For more information about this error, try `rustc --explain E0015`.
29-
Future incompatibility report: Future breakage diagnostic:
30-
error: erroneous constant used
31-
--> $DIR/issue-56164.rs:1:18
32-
|
33-
LL | const fn foo() { (||{})() }
34-
| ^^^^^^ referenced constant has errors
35-
|
36-
= note: `#[deny(const_err)]` on by default
37-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
38-
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
15+
error: aborting due to previous error
3916

17+
For more information about this error, try `rustc --explain E0277`.

Diff for: src/test/ui/consts/issue-68542-closure-in-array-len.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// in the length part of an array.
44

55
struct Bug {
6-
a: [(); (|| { 0 })()] //~ ERROR cannot call non-const closure
6+
a: [(); (|| { 0 })()] //~ ERROR the trait bound
77
}
88

99
fn main() {}
+10-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
error[E0015]: cannot call non-const closure in constants
1+
error[E0277]: the trait bound `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]: Fn<()>` is not satisfied
22
--> $DIR/issue-68542-closure-in-array-len.rs:6:13
33
|
44
LL | a: [(); (|| { 0 })()]
5-
| ^^^^^^^^^^^^
5+
| ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
6+
|
7+
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
8+
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`, but that implementation is not `const`
9+
--> $DIR/issue-68542-closure-in-array-len.rs:6:13
610
|
7-
= note: closures need an RFC before allowed to be called in constants
8-
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
11+
LL | a: [(); (|| { 0 })()]
12+
| ^^^^^^^^^^^^
13+
= note: wrap the `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]` in a closure with no arguments: `|| { /* code */ }`
914

1015
error: aborting due to previous error
1116

12-
For more information about this error, try `rustc --explain E0015`.
17+
For more information about this error, try `rustc --explain E0277`.

Diff for: src/test/ui/consts/unstable-const-fn-in-libcore.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// gate was not enabled in libcore.
55

66
#![stable(feature = "core", since = "1.6.0")]
7-
#![feature(staged_api)]
7+
#![feature(staged_api, const_trait_impl)]
88

99
enum Opt<T> {
1010
Some(T),
@@ -14,12 +14,12 @@ enum Opt<T> {
1414
impl<T> Opt<T> {
1515
#[rustc_const_unstable(feature = "foo", issue = "none")]
1616
#[stable(feature = "rust1", since = "1.0.0")]
17-
const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
17+
const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
1818
//~^ ERROR destructors cannot be evaluated at compile-time
1919
//~| ERROR destructors cannot be evaluated at compile-time
2020
match self {
2121
Opt::Some(t) => t,
22-
Opt::None => f(), //~ ERROR E0015
22+
Opt::None => f(),
2323
}
2424
}
2525
}
+8-21
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
error[E0015]: cannot call non-const closure in constant functions
2-
--> $DIR/unstable-const-fn-in-libcore.rs:22:26
3-
|
4-
LL | Opt::None => f(),
5-
| ^^^
6-
|
7-
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
8-
help: consider further restricting this bound
9-
|
10-
LL | const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T {
11-
| +++++++++++++++++++++++++++++
12-
131
error[E0493]: destructors cannot be evaluated at compile-time
14-
--> $DIR/unstable-const-fn-in-libcore.rs:17:53
2+
--> $DIR/unstable-const-fn-in-libcore.rs:17:60
153
|
16-
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
17-
| ^ constant functions cannot evaluate destructors
4+
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
5+
| ^ constant functions cannot evaluate destructors
186
...
197
LL | }
208
| - value is dropped here
219

2210
error[E0493]: destructors cannot be evaluated at compile-time
23-
--> $DIR/unstable-const-fn-in-libcore.rs:17:47
11+
--> $DIR/unstable-const-fn-in-libcore.rs:17:54
2412
|
25-
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
26-
| ^^^^ constant functions cannot evaluate destructors
13+
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
14+
| ^^^^ constant functions cannot evaluate destructors
2715
...
2816
LL | }
2917
| - value is dropped here
3018

31-
error: aborting due to 3 previous errors
19+
error: aborting due to 2 previous errors
3220

33-
Some errors have detailed explanations: E0015, E0493.
34-
For more information about an error, try `rustc --explain E0015`.
21+
For more information about this error, try `rustc --explain E0493`.

Diff for: src/test/ui/issues/issue-20605.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cann
22
--> $DIR/issue-20605.rs:2:17
33
|
44
LL | for item in *things { *item = 0 }
5-
| ^^^^^^^ the trait `~const IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
5+
| ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
66
|
77
= note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
88
= note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator`

Diff for: src/test/ui/issues/issue-32709.stderr

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ LL | Err(5)?;
77
| ^ the trait `From<{integer}>` is not implemented for `()`
88
|
99
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
10-
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
10+
= help: the following other types implement trait `FromResidual<R>`:
11+
<Result<T, F> as FromResidual<Result<Infallible, E>>>
12+
<Result<T, F> as FromResidual<Yeet<E>>>
1113
= note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>`
1214

1315
error: aborting due to previous error

Diff for: src/test/ui/suggestions/slice-issue-87994.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the size for values of type `[i32]` cannot be known at compilation
22
--> $DIR/slice-issue-87994.rs:3:12
33
|
44
LL | for _ in v[1..] {
5-
| ^^^^^^ the trait `~const IntoIterator` is not implemented for `[i32]`
5+
| ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
66
|
77
= note: the trait bound `[i32]: IntoIterator` is not satisfied
88
= note: required for `[i32]` to implement `IntoIterator`
@@ -17,7 +17,7 @@ error[E0277]: `[i32]` is not an iterator
1717
--> $DIR/slice-issue-87994.rs:3:12
1818
|
1919
LL | for _ in v[1..] {
20-
| ^^^^^^ the trait `~const IntoIterator` is not implemented for `[i32]`
20+
| ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
2121
|
2222
= note: the trait bound `[i32]: IntoIterator` is not satisfied
2323
= note: required for `[i32]` to implement `IntoIterator`
@@ -32,7 +32,7 @@ error[E0277]: the size for values of type `[K]` cannot be known at compilation t
3232
--> $DIR/slice-issue-87994.rs:11:13
3333
|
3434
LL | for i2 in v2[1..] {
35-
| ^^^^^^^ the trait `~const IntoIterator` is not implemented for `[K]`
35+
| ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
3636
|
3737
= note: the trait bound `[K]: IntoIterator` is not satisfied
3838
= note: required for `[K]` to implement `IntoIterator`
@@ -47,7 +47,7 @@ error[E0277]: `[K]` is not an iterator
4747
--> $DIR/slice-issue-87994.rs:11:13
4848
|
4949
LL | for i2 in v2[1..] {
50-
| ^^^^^^^ the trait `~const IntoIterator` is not implemented for `[K]`
50+
| ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
5151
|
5252
= note: the trait bound `[K]: IntoIterator` is not satisfied
5353
= note: required for `[K]` to implement `IntoIterator`

Diff for: src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ fn main() {
44
<i32 as Add<u32>>::add(1, 2);
55
//~^ ERROR cannot add `u32` to `i32`
66
//~| ERROR cannot add `u32` to `i32`
7-
//~| ERROR cannot add `u32` to `i32`
87
<i32 as Add<i32>>::add(1u32, 2);
98
//~^ ERROR mismatched types
109
<i32 as Add<i32>>::add(1, 2u32);

Diff for: src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr

+3-21
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,8 @@ LL | <i32 as Add<u32>>::add(1, 2);
1818
<&'a isize as Add<isize>>
1919
and 48 others
2020

21-
error[E0277]: cannot add `u32` to `i32`
22-
--> $DIR/ufcs-qpath-self-mismatch.rs:4:5
23-
|
24-
LL | <i32 as Add<u32>>::add(1, 2);
25-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
26-
|
27-
= help: the trait `Add<u32>` is not implemented for `i32`
28-
= help: the following other types implement trait `Add<Rhs>`:
29-
<&'a f32 as Add<f32>>
30-
<&'a f64 as Add<f64>>
31-
<&'a i128 as Add<i128>>
32-
<&'a i16 as Add<i16>>
33-
<&'a i32 as Add<i32>>
34-
<&'a i64 as Add<i64>>
35-
<&'a i8 as Add<i8>>
36-
<&'a isize as Add<isize>>
37-
and 48 others
38-
3921
error[E0308]: mismatched types
40-
--> $DIR/ufcs-qpath-self-mismatch.rs:8:28
22+
--> $DIR/ufcs-qpath-self-mismatch.rs:7:28
4123
|
4224
LL | <i32 as Add<i32>>::add(1u32, 2);
4325
| ---------------------- ^^^^ expected `i32`, found `u32`
@@ -55,7 +37,7 @@ LL | <i32 as Add<i32>>::add(1i32, 2);
5537
| ~~~
5638

5739
error[E0308]: mismatched types
58-
--> $DIR/ufcs-qpath-self-mismatch.rs:10:31
40+
--> $DIR/ufcs-qpath-self-mismatch.rs:9:31
5941
|
6042
LL | <i32 as Add<i32>>::add(1, 2u32);
6143
| ---------------------- ^^^^ expected `i32`, found `u32`
@@ -90,7 +72,7 @@ LL | <i32 as Add<u32>>::add(1, 2);
9072
<&'a isize as Add<isize>>
9173
and 48 others
9274

93-
error: aborting due to 5 previous errors
75+
error: aborting due to 4 previous errors
9476

9577
Some errors have detailed explanations: E0277, E0308.
9678
For more information about an error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)