mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
bless tests again
This commit is contained in:
parent
5ead742e18
commit
191d3b76db
@ -1,6 +1,6 @@
|
||||
struct X<const N: usize = {
|
||||
(||1usize)()
|
||||
//~^ ERROR cannot call
|
||||
//~^ ERROR the trait bound
|
||||
}>;
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,12 +1,17 @@
|
||||
error[E0015]: cannot call non-const closure in constants
|
||||
error[E0277]: the trait bound `[closure@$DIR/issue-93647.rs:2:6: 2:8]: Fn<()>` is not satisfied
|
||||
--> $DIR/issue-93647.rs:2:5
|
||||
|
|
||||
LL | (||1usize)()
|
||||
| ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
|
||||
|
|
||||
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-93647.rs:2:6: 2:8]`
|
||||
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-93647.rs:2:6: 2:8]`, but that implementation is not `const`
|
||||
--> $DIR/issue-93647.rs:2:5
|
||||
|
|
||||
LL | (||1usize)()
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures need an RFC before allowed to be called in constants
|
||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||
= note: wrap the `[closure@$DIR/issue-93647.rs:2:6: 2:8]` in a closure with no arguments: `|| { /* code */ }`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
const X: u8 =
|
||||
|| -> u8 { 5 }()
|
||||
//~^ ERROR cannot call non-const closure
|
||||
//~^ ERROR the trait bound
|
||||
;
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,12 +1,17 @@
|
||||
error[E0015]: cannot call non-const closure in constants
|
||||
error[E0277]: the trait bound `[closure@$DIR/issue-28113.rs:4:5: 4:13]: Fn<()>` is not satisfied
|
||||
--> $DIR/issue-28113.rs:4:5
|
||||
|
|
||||
LL | || -> u8 { 5 }()
|
||||
| ^^^^^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
|
||||
|
|
||||
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-28113.rs:4:5: 4:13]`
|
||||
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-28113.rs:4:5: 4:13]`, but that implementation is not `const`
|
||||
--> $DIR/issue-28113.rs:4:5
|
||||
|
|
||||
LL | || -> u8 { 5 }()
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures need an RFC before allowed to be called in constants
|
||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||
= note: wrap the `[closure@$DIR/issue-28113.rs:4:5: 4:13]` in a closure with no arguments: `|| { /* code */ }`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -1,11 +1,8 @@
|
||||
const fn foo() { (||{})() }
|
||||
//~^ ERROR cannot call non-const closure
|
||||
//~| ERROR erroneous constant used [const_err]
|
||||
//~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
//~^ ERROR the trait bound
|
||||
|
||||
const fn bad(input: fn()) {
|
||||
input()
|
||||
//~^ ERROR function pointer
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
@ -1,39 +1,17 @@
|
||||
error[E0015]: cannot call non-const closure in constant functions
|
||||
error[E0277]: the trait bound `[closure@$DIR/issue-56164.rs:1:19: 1:21]: Fn<()>` is not satisfied
|
||||
--> $DIR/issue-56164.rs:1:18
|
||||
|
|
||||
LL | const fn foo() { (||{})() }
|
||||
| ^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
|
||||
|
|
||||
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-56164.rs:1:19: 1:21]`
|
||||
note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-56164.rs:1:19: 1:21]`, but that implementation is not `const`
|
||||
--> $DIR/issue-56164.rs:1:18
|
||||
|
|
||||
LL | const fn foo() { (||{})() }
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: closures need an RFC before allowed to be called in constant functions
|
||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
= note: wrap the `[closure@$DIR/issue-56164.rs:1:19: 1:21]` in a closure with no arguments: `|| { /* code */ }`
|
||||
|
||||
error: function pointer calls are not allowed in constant functions
|
||||
--> $DIR/issue-56164.rs:7:5
|
||||
|
|
||||
LL | input()
|
||||
| ^^^^^^^
|
||||
|
||||
error: erroneous constant used
|
||||
--> $DIR/issue-56164.rs:1:18
|
||||
|
|
||||
LL | const fn foo() { (||{})() }
|
||||
| ^^^^^^ referenced constant has errors
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
||||
Future incompatibility report: Future breakage diagnostic:
|
||||
error: erroneous constant used
|
||||
--> $DIR/issue-56164.rs:1:18
|
||||
|
|
||||
LL | const fn foo() { (||{})() }
|
||||
| ^^^^^^ referenced constant has errors
|
||||
|
|
||||
= note: `#[deny(const_err)]` on by default
|
||||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
|
||||
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -3,7 +3,7 @@
|
||||
// in the length part of an array.
|
||||
|
||||
struct Bug {
|
||||
a: [(); (|| { 0 })()] //~ ERROR cannot call non-const closure
|
||||
a: [(); (|| { 0 })()] //~ ERROR the trait bound
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
@ -1,12 +1,17 @@
|
||||
error[E0015]: cannot call non-const closure in constants
|
||||
error[E0277]: the trait bound `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]: Fn<()>` is not satisfied
|
||||
--> $DIR/issue-68542-closure-in-array-len.rs:6:13
|
||||
|
|
||||
LL | a: [(); (|| { 0 })()]
|
||||
| ^^^^^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
|
||||
|
|
||||
= help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]`
|
||||
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`
|
||||
--> $DIR/issue-68542-closure-in-array-len.rs:6:13
|
||||
|
|
||||
LL | a: [(); (|| { 0 })()]
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= note: closures need an RFC before allowed to be called in constants
|
||||
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
|
||||
= note: wrap the `[closure@$DIR/issue-68542-closure-in-array-len.rs:6:14: 6:16]` in a closure with no arguments: `|| { /* code */ }`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0015`.
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
@ -4,7 +4,7 @@
|
||||
// gate was not enabled in libcore.
|
||||
|
||||
#![stable(feature = "core", since = "1.6.0")]
|
||||
#![feature(staged_api)]
|
||||
#![feature(staged_api, const_trait_impl)]
|
||||
|
||||
enum Opt<T> {
|
||||
Some(T),
|
||||
@ -14,12 +14,12 @@ enum Opt<T> {
|
||||
impl<T> Opt<T> {
|
||||
#[rustc_const_unstable(feature = "foo", issue = "none")]
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
|
||||
const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
||||
//~^ ERROR destructors cannot be evaluated at compile-time
|
||||
//~| ERROR destructors cannot be evaluated at compile-time
|
||||
match self {
|
||||
Opt::Some(t) => t,
|
||||
Opt::None => f(), //~ ERROR E0015
|
||||
Opt::None => f(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,34 +1,21 @@
|
||||
error[E0015]: cannot call non-const closure in constant functions
|
||||
--> $DIR/unstable-const-fn-in-libcore.rs:22:26
|
||||
|
|
||||
LL | Opt::None => f(),
|
||||
| ^^^
|
||||
|
|
||||
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | const fn unwrap_or_else<F: FnOnce() -> T + ~const std::ops::FnOnce<()>>(self, f: F) -> T {
|
||||
| +++++++++++++++++++++++++++++
|
||||
|
||||
error[E0493]: destructors cannot be evaluated at compile-time
|
||||
--> $DIR/unstable-const-fn-in-libcore.rs:17:53
|
||||
--> $DIR/unstable-const-fn-in-libcore.rs:17:60
|
||||
|
|
||||
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
|
||||
| ^ constant functions cannot evaluate destructors
|
||||
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
||||
| ^ constant functions cannot evaluate destructors
|
||||
...
|
||||
LL | }
|
||||
| - value is dropped here
|
||||
|
||||
error[E0493]: destructors cannot be evaluated at compile-time
|
||||
--> $DIR/unstable-const-fn-in-libcore.rs:17:47
|
||||
--> $DIR/unstable-const-fn-in-libcore.rs:17:54
|
||||
|
|
||||
LL | const fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
|
||||
| ^^^^ constant functions cannot evaluate destructors
|
||||
LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
|
||||
| ^^^^ constant functions cannot evaluate destructors
|
||||
...
|
||||
LL | }
|
||||
| - value is dropped here
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0015, E0493.
|
||||
For more information about an error, try `rustc --explain E0015`.
|
||||
For more information about this error, try `rustc --explain E0493`.
|
||||
|
@ -2,7 +2,7 @@ error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cann
|
||||
--> $DIR/issue-20605.rs:2:17
|
||||
|
|
||||
LL | for item in *things { *item = 0 }
|
||||
| ^^^^^^^ the trait `~const IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
|
||||
| ^^^^^^^ the trait `IntoIterator` is not implemented for `dyn Iterator<Item = &'a mut u8>`
|
||||
|
|
||||
= note: the trait bound `dyn Iterator<Item = &'a mut u8>: IntoIterator` is not satisfied
|
||||
= note: required for `dyn Iterator<Item = &'a mut u8>` to implement `IntoIterator`
|
||||
|
@ -7,7 +7,9 @@ LL | Err(5)?;
|
||||
| ^ the trait `From<{integer}>` is not implemented for `()`
|
||||
|
|
||||
= note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait
|
||||
= help: the trait `FromResidual<Result<Infallible, E>>` is implemented for `Result<T, F>`
|
||||
= help: the following other types implement trait `FromResidual<R>`:
|
||||
<Result<T, F> as FromResidual<Result<Infallible, E>>>
|
||||
<Result<T, F> as FromResidual<Yeet<E>>>
|
||||
= note: required for `Result<i32, ()>` to implement `FromResidual<Result<Infallible, {integer}>>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -2,7 +2,7 @@ error[E0277]: the size for values of type `[i32]` cannot be known at compilation
|
||||
--> $DIR/slice-issue-87994.rs:3:12
|
||||
|
|
||||
LL | for _ in v[1..] {
|
||||
| ^^^^^^ the trait `~const IntoIterator` is not implemented for `[i32]`
|
||||
| ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
|
||||
|
|
||||
= note: the trait bound `[i32]: IntoIterator` is not satisfied
|
||||
= note: required for `[i32]` to implement `IntoIterator`
|
||||
@ -17,7 +17,7 @@ error[E0277]: `[i32]` is not an iterator
|
||||
--> $DIR/slice-issue-87994.rs:3:12
|
||||
|
|
||||
LL | for _ in v[1..] {
|
||||
| ^^^^^^ the trait `~const IntoIterator` is not implemented for `[i32]`
|
||||
| ^^^^^^ the trait `IntoIterator` is not implemented for `[i32]`
|
||||
|
|
||||
= note: the trait bound `[i32]: IntoIterator` is not satisfied
|
||||
= 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
|
||||
--> $DIR/slice-issue-87994.rs:11:13
|
||||
|
|
||||
LL | for i2 in v2[1..] {
|
||||
| ^^^^^^^ the trait `~const IntoIterator` is not implemented for `[K]`
|
||||
| ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
|
||||
|
|
||||
= note: the trait bound `[K]: IntoIterator` is not satisfied
|
||||
= note: required for `[K]` to implement `IntoIterator`
|
||||
@ -47,7 +47,7 @@ error[E0277]: `[K]` is not an iterator
|
||||
--> $DIR/slice-issue-87994.rs:11:13
|
||||
|
|
||||
LL | for i2 in v2[1..] {
|
||||
| ^^^^^^^ the trait `~const IntoIterator` is not implemented for `[K]`
|
||||
| ^^^^^^^ the trait `IntoIterator` is not implemented for `[K]`
|
||||
|
|
||||
= note: the trait bound `[K]: IntoIterator` is not satisfied
|
||||
= note: required for `[K]` to implement `IntoIterator`
|
||||
|
@ -4,7 +4,6 @@ fn main() {
|
||||
<i32 as Add<u32>>::add(1, 2);
|
||||
//~^ ERROR cannot add `u32` to `i32`
|
||||
//~| ERROR cannot add `u32` to `i32`
|
||||
//~| ERROR cannot add `u32` to `i32`
|
||||
<i32 as Add<i32>>::add(1u32, 2);
|
||||
//~^ ERROR mismatched types
|
||||
<i32 as Add<i32>>::add(1, 2u32);
|
||||
|
@ -18,26 +18,8 @@ LL | <i32 as Add<u32>>::add(1, 2);
|
||||
<&'a isize as Add<isize>>
|
||||
and 48 others
|
||||
|
||||
error[E0277]: cannot add `u32` to `i32`
|
||||
--> $DIR/ufcs-qpath-self-mismatch.rs:4:5
|
||||
|
|
||||
LL | <i32 as Add<u32>>::add(1, 2);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
|
||||
|
|
||||
= help: the trait `Add<u32>` is not implemented for `i32`
|
||||
= help: the following other types implement trait `Add<Rhs>`:
|
||||
<&'a f32 as Add<f32>>
|
||||
<&'a f64 as Add<f64>>
|
||||
<&'a i128 as Add<i128>>
|
||||
<&'a i16 as Add<i16>>
|
||||
<&'a i32 as Add<i32>>
|
||||
<&'a i64 as Add<i64>>
|
||||
<&'a i8 as Add<i8>>
|
||||
<&'a isize as Add<isize>>
|
||||
and 48 others
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/ufcs-qpath-self-mismatch.rs:8:28
|
||||
--> $DIR/ufcs-qpath-self-mismatch.rs:7:28
|
||||
|
|
||||
LL | <i32 as Add<i32>>::add(1u32, 2);
|
||||
| ---------------------- ^^^^ expected `i32`, found `u32`
|
||||
@ -55,7 +37,7 @@ LL | <i32 as Add<i32>>::add(1i32, 2);
|
||||
| ~~~
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/ufcs-qpath-self-mismatch.rs:10:31
|
||||
--> $DIR/ufcs-qpath-self-mismatch.rs:9:31
|
||||
|
|
||||
LL | <i32 as Add<i32>>::add(1, 2u32);
|
||||
| ---------------------- ^^^^ expected `i32`, found `u32`
|
||||
@ -90,7 +72,7 @@ LL | <i32 as Add<u32>>::add(1, 2);
|
||||
<&'a isize as Add<isize>>
|
||||
and 48 others
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
Some errors have detailed explanations: E0277, E0308.
|
||||
For more information about an error, try `rustc --explain E0277`.
|
||||
|
Loading…
Reference in New Issue
Block a user