mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-06 04:08:40 +00:00
Update tests
This commit is contained in:
parent
4ee1840c0c
commit
550948c553
@ -7,7 +7,7 @@ const fn f(x: usize) -> usize {
|
|||||||
//~| ERROR calls in constant functions
|
//~| ERROR calls in constant functions
|
||||||
//~| ERROR calls in constant functions
|
//~| ERROR calls in constant functions
|
||||||
//~| ERROR E0080
|
//~| ERROR E0080
|
||||||
//~| ERROR E0744
|
//~| ERROR `for` is not allowed in a `const fn`
|
||||||
sum += i;
|
sum += i;
|
||||||
}
|
}
|
||||||
sum
|
sum
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
error[E0744]: `for` is not allowed in a `const fn`
|
error[E0658]: `for` is not allowed in a `const fn`
|
||||||
--> $DIR/const-fn-error.rs:5:5
|
--> $DIR/const-fn-error.rs:5:5
|
||||||
|
|
|
|
||||||
LL | / for i in 0..x {
|
LL | / for i in 0..x {
|
||||||
@ -9,6 +9,9 @@ LL | |
|
|||||||
LL | | sum += i;
|
LL | | sum += i;
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||||
--> $DIR/const-fn-error.rs:5:14
|
--> $DIR/const-fn-error.rs:5:14
|
||||||
@ -45,5 +48,5 @@ LL | let a : [i32; f(X)];
|
|||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
Some errors have detailed explanations: E0015, E0080, E0658, E0744.
|
Some errors have detailed explanations: E0015, E0080, E0658.
|
||||||
For more information about an error, try `rustc --explain E0015`.
|
For more information about an error, try `rustc --explain E0015`.
|
||||||
|
@ -4,6 +4,7 @@ error[E0658]: `for` is not allowed in a `const`
|
|||||||
LL | for _ in 0..5 {}
|
LL | for _ in 0..5 {}
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -4,6 +4,7 @@ error[E0658]: `?` is not allowed in a `const fn`
|
|||||||
LL | Some(())?;
|
LL | Some(())?;
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
|
= note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
|
||||||
= help: add `#![feature(const_try)]` to the crate attributes to enable
|
= help: add `#![feature(const_try)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
@ -1,19 +1,25 @@
|
|||||||
error[E0744]: `for` is not allowed in a `const`
|
error[E0658]: `for` is not allowed in a `const`
|
||||||
--> $DIR/loop.rs:53:5
|
--> $DIR/loop.rs:53:5
|
||||||
|
|
|
|
||||||
LL | / for i in 0..4 {
|
LL | / for i in 0..4 {
|
||||||
LL | | x += i;
|
LL | | x += i;
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0744]: `for` is not allowed in a `const`
|
error[E0658]: `for` is not allowed in a `const`
|
||||||
--> $DIR/loop.rs:57:5
|
--> $DIR/loop.rs:57:5
|
||||||
|
|
|
|
||||||
LL | / for i in 0..4 {
|
LL | / for i in 0..4 {
|
||||||
LL | | x += i;
|
LL | | x += i;
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^
|
||||||
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0744`.
|
For more information about this error, try `rustc --explain E0658`.
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
error[E0744]: `?` is not allowed in a `const fn`
|
error[E0658]: `?` is not allowed in a `const fn`
|
||||||
--> $DIR/try.rs:6:5
|
--> $DIR/try.rs:6:5
|
||||||
|
|
|
|
||||||
LL | x?;
|
LL | x?;
|
||||||
| ^^
|
| ^^
|
||||||
|
|
|
||||||
|
= note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
|
||||||
|
= help: add `#![feature(const_try)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0744`.
|
For more information about this error, try `rustc --explain E0658`.
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
error[E0744]: `for` is not allowed in a `const`
|
error[E0658]: `for` is not allowed in a `const`
|
||||||
--> $DIR/issue-50582.rs:2:20
|
--> $DIR/issue-50582.rs:2:20
|
||||||
|
|
|
|
||||||
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
|
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0277]: cannot add `()` to `{integer}`
|
error[E0277]: cannot add `()` to `{integer}`
|
||||||
--> $DIR/issue-50582.rs:2:18
|
--> $DIR/issue-50582.rs:2:18
|
||||||
@ -14,5 +17,5 @@ LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
|
|||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
Some errors have detailed explanations: E0277, E0744.
|
Some errors have detailed explanations: E0277, E0658.
|
||||||
For more information about an error, try `rustc --explain E0277`.
|
For more information about an error, try `rustc --explain E0277`.
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
error[E0744]: `for` is not allowed in a `const`
|
error[E0658]: `for` is not allowed in a `const`
|
||||||
--> $DIR/issue-50585.rs:2:18
|
--> $DIR/issue-50585.rs:2:18
|
||||||
|
|
|
|
||||||
LL | |y: Vec<[(); for x in 0..2 {}]>| {};
|
LL | |y: Vec<[(); for x in 0..2 {}]>| {};
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-50585.rs:2:18
|
--> $DIR/issue-50585.rs:2:18
|
||||||
@ -12,5 +15,5 @@ LL | |y: Vec<[(); for x in 0..2 {}]>| {};
|
|||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
Some errors have detailed explanations: E0308, E0744.
|
Some errors have detailed explanations: E0308, E0658.
|
||||||
For more information about an error, try `rustc --explain E0308`.
|
For more information about an error, try `rustc --explain E0308`.
|
||||||
|
@ -6,11 +6,14 @@ LL | [(); {while true {break}; 0}];
|
|||||||
|
|
|
|
||||||
= note: `#[warn(while_true)]` on by default
|
= note: `#[warn(while_true)]` on by default
|
||||||
|
|
||||||
error[E0744]: `for` is not allowed in a `const`
|
error[E0658]: `for` is not allowed in a `const`
|
||||||
--> $DIR/issue-52443.rs:9:12
|
--> $DIR/issue-52443.rs:9:12
|
||||||
|
|
|
|
||||||
LL | [(); { for _ in 0usize.. {}; 0}];
|
LL | [(); { for _ in 0usize.. {}; 0}];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
|
||||||
|
= help: add `#![feature(const_for)]` to the crate attributes to enable
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue-52443.rs:2:10
|
--> $DIR/issue-52443.rs:2:10
|
||||||
@ -56,5 +59,5 @@ LL | [(); { for _ in 0usize.. {}; 0}];
|
|||||||
|
|
||||||
error: aborting due to 6 previous errors; 1 warning emitted
|
error: aborting due to 6 previous errors; 1 warning emitted
|
||||||
|
|
||||||
Some errors have detailed explanations: E0015, E0308, E0658, E0744.
|
Some errors have detailed explanations: E0015, E0308, E0658.
|
||||||
For more information about an error, try `rustc --explain E0015`.
|
For more information about an error, try `rustc --explain E0015`.
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
error[E0744]: `?` is not allowed in a `const fn`
|
error[E0658]: `?` is not allowed in a `const fn`
|
||||||
--> $DIR/hir-const-check.rs:11:9
|
--> $DIR/hir-const-check.rs:11:9
|
||||||
|
|
|
|
||||||
LL | Some(())?;
|
LL | Some(())?;
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
|
||||||
|
= note: see issue #74935 <https://github.com/rust-lang/rust/issues/74935> for more information
|
||||||
|
= help: add `#![feature(const_try)]` to the crate attributes to enable
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0744`.
|
For more information about this error, try `rustc --explain E0658`.
|
||||||
|
Loading…
Reference in New Issue
Block a user