Skip to content

Commit 550948c

Browse files
Update tests
1 parent 4ee1840 commit 550948c

10 files changed

+42
-16
lines changed

src/test/ui/consts/const-fn-error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const fn f(x: usize) -> usize {
77
//~| ERROR calls in constant functions
88
//~| ERROR calls in constant functions
99
//~| ERROR E0080
10-
//~| ERROR E0744
10+
//~| ERROR `for` is not allowed in a `const fn`
1111
sum += i;
1212
}
1313
sum

src/test/ui/consts/const-fn-error.stderr

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0744]: `for` is not allowed in a `const fn`
1+
error[E0658]: `for` is not allowed in a `const fn`
22
--> $DIR/const-fn-error.rs:5:5
33
|
44
LL | / for i in 0..x {
@@ -9,6 +9,9 @@ LL | |
99
LL | | sum += i;
1010
LL | | }
1111
| |_____^
12+
|
13+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
14+
= help: add `#![feature(const_for)]` to the crate attributes to enable
1215

1316
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
1417
--> $DIR/const-fn-error.rs:5:14
@@ -45,5 +48,5 @@ LL | let a : [i32; f(X)];
4548

4649
error: aborting due to 5 previous errors
4750

48-
Some errors have detailed explanations: E0015, E0080, E0658, E0744.
51+
Some errors have detailed explanations: E0015, E0080, E0658.
4952
For more information about an error, try `rustc --explain E0015`.

src/test/ui/consts/const-for-feature-gate.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error[E0658]: `for` is not allowed in a `const`
44
LL | for _ in 0..5 {}
55
| ^^^^^^^^^^^^^^^^
66
|
7+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
78
= help: add `#![feature(const_for)]` to the crate attributes to enable
89

910
error: aborting due to previous error

src/test/ui/consts/const-try-feature-gate.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error[E0658]: `?` is not allowed in a `const fn`
44
LL | Some(())?;
55
| ^^^^^^^^^
66
|
7+
= note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
78
= help: add `#![feature(const_try)]` to the crate attributes to enable
89

910
error: aborting due to previous error
+9-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
error[E0744]: `for` is not allowed in a `const`
1+
error[E0658]: `for` is not allowed in a `const`
22
--> $DIR/loop.rs:53:5
33
|
44
LL | / for i in 0..4 {
55
LL | | x += i;
66
LL | | }
77
| |_____^
8+
|
9+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
10+
= help: add `#![feature(const_for)]` to the crate attributes to enable
811

9-
error[E0744]: `for` is not allowed in a `const`
12+
error[E0658]: `for` is not allowed in a `const`
1013
--> $DIR/loop.rs:57:5
1114
|
1215
LL | / for i in 0..4 {
1316
LL | | x += i;
1417
LL | | }
1518
| |_____^
19+
|
20+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
21+
= help: add `#![feature(const_for)]` to the crate attributes to enable
1622

1723
error: aborting due to 2 previous errors
1824

19-
For more information about this error, try `rustc --explain E0744`.
25+
For more information about this error, try `rustc --explain E0658`.
+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
error[E0744]: `?` is not allowed in a `const fn`
1+
error[E0658]: `?` is not allowed in a `const fn`
22
--> $DIR/try.rs:6:5
33
|
44
LL | x?;
55
| ^^
6+
|
7+
= note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
8+
= help: add `#![feature(const_try)]` to the crate attributes to enable
69

710
error: aborting due to previous error
811

9-
For more information about this error, try `rustc --explain E0744`.
12+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/issues/issue-50582.stderr

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
error[E0744]: `for` is not allowed in a `const`
1+
error[E0658]: `for` is not allowed in a `const`
22
--> $DIR/issue-50582.rs:2:20
33
|
44
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
55
| ^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
8+
= help: add `#![feature(const_for)]` to the crate attributes to enable
69

710
error[E0277]: cannot add `()` to `{integer}`
811
--> $DIR/issue-50582.rs:2:18
@@ -14,5 +17,5 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
1417

1518
error: aborting due to 2 previous errors
1619

17-
Some errors have detailed explanations: E0277, E0744.
20+
Some errors have detailed explanations: E0277, E0658.
1821
For more information about an error, try `rustc --explain E0277`.

src/test/ui/issues/issue-50585.stderr

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
error[E0744]: `for` is not allowed in a `const`
1+
error[E0658]: `for` is not allowed in a `const`
22
--> $DIR/issue-50585.rs:2:18
33
|
44
LL | |y: Vec<[(); for x in 0..2 {}]>| {};
55
| ^^^^^^^^^^^^^^^^
6+
|
7+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
8+
= help: add `#![feature(const_for)]` to the crate attributes to enable
69

710
error[E0308]: mismatched types
811
--> $DIR/issue-50585.rs:2:18
@@ -12,5 +15,5 @@ LL | |y: Vec<[(); for x in 0..2 {}]>| {};
1215

1316
error: aborting due to 2 previous errors
1417

15-
Some errors have detailed explanations: E0308, E0744.
18+
Some errors have detailed explanations: E0308, E0658.
1619
For more information about an error, try `rustc --explain E0308`.

src/test/ui/never_type/issue-52443.stderr

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ LL | [(); {while true {break}; 0}];
66
|
77
= note: `#[warn(while_true)]` on by default
88

9-
error[E0744]: `for` is not allowed in a `const`
9+
error[E0658]: `for` is not allowed in a `const`
1010
--> $DIR/issue-52443.rs:9:12
1111
|
1212
LL | [(); { for _ in 0usize.. {}; 0}];
1313
| ^^^^^^^^^^^^^^^^^^^^
14+
|
15+
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
16+
= help: add `#![feature(const_for)]` to the crate attributes to enable
1417

1518
error[E0308]: mismatched types
1619
--> $DIR/issue-52443.rs:2:10
@@ -56,5 +59,5 @@ LL | [(); { for _ in 0usize.. {}; 0}];
5659

5760
error: aborting due to 6 previous errors; 1 warning emitted
5861

59-
Some errors have detailed explanations: E0015, E0308, E0658, E0744.
62+
Some errors have detailed explanations: E0015, E0308, E0658.
6063
For more information about an error, try `rustc --explain E0015`.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
error[E0744]: `?` is not allowed in a `const fn`
1+
error[E0658]: `?` is not allowed in a `const fn`
22
--> $DIR/hir-const-check.rs:11:9
33
|
44
LL | Some(())?;
55
| ^^^^^^^^^
6+
|
7+
= note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
8+
= help: add `#![feature(const_try)]` to the crate attributes to enable
69

710
error: aborting due to previous error
811

9-
For more information about this error, try `rustc --explain E0744`.
12+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)