Skip to content

Commit

Permalink
bless the known-bug tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead committed Sep 20, 2023
1 parent 7446012 commit 2063ebc
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 109 deletions.
9 changes: 6 additions & 3 deletions tests/ui/consts/const-block-const-bound.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-block-const-bound.rs:8:22
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/const-block-const-bound.rs:8:32
|
LL | const fn f<T: ~const Destruct>(x: T) {}
| ^^^^^^^^
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error

For more information about this error, try `rustc --explain E0493`.
26 changes: 1 addition & 25 deletions tests/ui/consts/fn_trait_refs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ error: ~const can only be applied to `#[const_trait]` traits
LL | T: ~const Fn<()> + ~const Destruct,
| ^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:15:31
|
LL | T: ~const Fn<()> + ~const Destruct,
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:15:15
|
Expand All @@ -34,12 +28,6 @@ error: ~const can only be applied to `#[const_trait]` traits
LL | T: ~const FnMut<()> + ~const Destruct,
| ^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:22:34
|
LL | T: ~const FnMut<()> + ~const Destruct,
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:22:15
|
Expand All @@ -64,12 +52,6 @@ error: ~const can only be applied to `#[const_trait]` traits
LL | T: ~const Fn<()> + ~const Destruct,
| ^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:36:31
|
LL | T: ~const Fn<()> + ~const Destruct,
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:36:15
|
Expand All @@ -82,18 +64,12 @@ error: ~const can only be applied to `#[const_trait]` traits
LL | T: ~const FnMut<()> + ~const Destruct,
| ^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:50:34
|
LL | T: ~const FnMut<()> + ~const Destruct,
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/fn_trait_refs.rs:50:15
|
LL | T: ~const FnMut<()> + ~const Destruct,
| ^^^^^^^^^

error: aborting due to 16 previous errors
error: aborting due to 12 previous errors

For more information about this error, try `rustc --explain E0635`.
8 changes: 1 addition & 7 deletions tests/ui/impl-trait/normalize-tait-in-const.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,5 @@ error: ~const can only be applied to `#[const_trait]` traits
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^^^^^^^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/normalize-tait-in-const.rs:25:69
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^^^^^^

error: aborting due to 2 previous errors
error: aborting due to previous error

23 changes: 6 additions & 17 deletions tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.stderr
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop-bound.rs:9:68
error[E0493]: destructor of `E` cannot be evaluated at compile-time
--> $DIR/const-drop-bound.rs:12:13
|
LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct {
| ^^^^^^^^
LL | Err(_e) => None,
| ^^ the destructor for this type cannot be evaluated in constant functions

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop-bound.rs:20:15
|
LL | T: ~const Destruct,
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop-bound.rs:21:15
|
LL | E: ~const Destruct,
| ^^^^^^^^

error: aborting due to 3 previous errors
error: aborting due to previous error

For more information about this error, try `rustc --explain E0493`.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop-fail-2.rs:21:26
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/const-drop-fail-2.rs:21:36
|
LL | const fn check<T: ~const Destruct>(_: T) {}
| ^^^^^^^^
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error

For more information about this error, try `rustc --explain E0493`.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop-fail.rs:24:26
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/const-drop-fail.rs:24:36
|
LL | const fn check<T: ~const Destruct>(_: T) {}
| ^^^^^^^^
| ^ the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error

For more information about this error, try `rustc --explain E0493`.
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop-fail.rs:24:26
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/const-drop-fail.rs:24:36
|
LL | const fn check<T: ~const Destruct>(_: T) {}
| ^^^^^^^^
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error

For more information about this error, try `rustc --explain E0493`.
19 changes: 15 additions & 4 deletions tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.precise.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop.rs:19:22
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/const-drop.rs:19:32
|
LL | const fn a<T: ~const Destruct>(_: T) {}
| ^^^^^^^^
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error
error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
--> $DIR/const-drop.rs:24:13
|
LL | let _ = S(&mut c);
| ^^^^^^^^^- value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0493`.
19 changes: 15 additions & 4 deletions tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.stock.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-drop.rs:19:22
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/const-drop.rs:19:32
|
LL | const fn a<T: ~const Destruct>(_: T) {}
| ^^^^^^^^
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error
error[E0493]: destructor of `S<'_>` cannot be evaluated at compile-time
--> $DIR/const-drop.rs:24:13
|
LL | let _ = S(&mut c);
| ^^^^^^^^^- value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0493`.
38 changes: 1 addition & 37 deletions tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,60 +16,24 @@ error: ~const can only be applied to `#[const_trait]` traits
LL | const fn wrap(x: impl ~const PartialEq + ~const Destruct)
| ^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:16:49
|
LL | const fn wrap(x: impl ~const PartialEq + ~const Destruct)
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:17:20
|
LL | -> impl ~const PartialEq + ~const Destruct
| ^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:17:39
|
LL | -> impl ~const PartialEq + ~const Destruct
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:24:29
|
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
| ^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:24:48
|
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy;
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:28:29
|
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy {
| ^^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:28:48
|
LL | fn huh() -> impl ~const PartialEq + ~const Destruct + Copy {
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:49:41
|
LL | const fn apit(_: impl ~const T + ~const Destruct) {}
| ^^^^^^^^

error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/const-impl-trait.rs:53:73
|
LL | const fn apit_assoc_bound(_: impl IntoIterator<Item: ~const T> + ~const Destruct) {}
| ^^^^^^^^

error: aborting due to 12 previous errors
error: aborting due to 6 previous errors

For more information about this error, try `rustc --explain E0635`.
9 changes: 6 additions & 3 deletions tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/issue-92111.rs:20:22
error[E0493]: destructor of `T` cannot be evaluated at compile-time
--> $DIR/issue-92111.rs:20:32
|
LL | const fn a<T: ~const Destruct>(t: T) {}
| ^^^^^^^^
| ^ - value is dropped here
| |
| the destructor for this type cannot be evaluated in constant functions

error: aborting due to previous error

For more information about this error, try `rustc --explain E0493`.

0 comments on commit 2063ebc

Please sign in to comment.