Skip to content

Commit 1b20e48

Browse files
committed
bless
1 parent 11dc0a0 commit 1b20e48

15 files changed

+51
-114
lines changed

tests/ui/const-generics/backcompat/impossible_preds_repeat_expr_hack.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ where
2525
let _a: [(); 1] = [(); <u8 as Trait<()>>::ASSOC];
2626
//~^ WARN: cannot use constants which depend on trivially-false where clauses
2727
//~| WARN: this was previously accepted by the compiler
28-
//~^^^ WARN: cannot use constants which depend on trivially-false where clauses
29-
//~| WARN: this was previously accepted by the compiler
28+
//~^^^ ERROR: mismatched types
3029
}
3130

3231
struct Foo<const N: usize>;

tests/ui/const-generics/backcompat/impossible_preds_repeat_expr_hack.stderr

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,16 @@ LL | let _a: [(); 1] = [(); <u8 as Trait<()>>::ASSOC];
88
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
99
= note: `#[warn(const_evaluatable_unchecked)]` on by default
1010

11-
warning: cannot use constants which depend on trivially-false where clauses
12-
--> $DIR/impossible_preds_repeat_expr_hack.rs:25:28
11+
error[E0308]: mismatched types
12+
--> $DIR/impossible_preds_repeat_expr_hack.rs:25:23
1313
|
1414
LL | let _a: [(); 1] = [(); <u8 as Trait<()>>::ASSOC];
15-
| ^^^^^^^^^^^^^^^^^^^^^^^^
16-
|
17-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
18-
= note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200>
19-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
15+
| ------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an array with a size of 1, found one with a size of <u8 as Trait<()>>::ASSOC
16+
| |
17+
| expected due to this
2018

2119
error[E0277]: the trait bound `for<'a> (): Unimplemented<'a>` is not satisfied
22-
--> $DIR/impossible_preds_repeat_expr_hack.rs:38:43
20+
--> $DIR/impossible_preds_repeat_expr_hack.rs:37:43
2321
|
2422
LL | let _a: Foo<1> = Foo::<{ <u8 as Trait<()>>::ASSOC }>;
2523
| ^^ the trait `for<'a> Unimplemented<'a>` is not implemented for `()`
@@ -39,7 +37,7 @@ LL | const ASSOC: usize;
3937
| ----- required by a bound in this associated constant
4038

4139
error[E0277]: the trait bound `for<'a> (): Unimplemented<'a>` is not satisfied
42-
--> $DIR/impossible_preds_repeat_expr_hack.rs:38:31
40+
--> $DIR/impossible_preds_repeat_expr_hack.rs:37:31
4341
|
4442
LL | let _a: Foo<1> = Foo::<{ <u8 as Trait<()>>::ASSOC }>;
4543
| ^^ the trait `for<'a> Unimplemented<'a>` is not implemented for `()`
@@ -58,6 +56,7 @@ LL | where
5856
LL | for<'a> T: Unimplemented<'a>,
5957
| ----------------- unsatisfied trait bound introduced here
6058

61-
error: aborting due to 2 previous errors; 2 warnings emitted
59+
error: aborting due to 3 previous errors; 1 warning emitted
6260

63-
For more information about this error, try `rustc --explain E0277`.
61+
Some errors have detailed explanations: E0277, E0308.
62+
For more information about an error, try `rustc --explain E0277`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
//@ check-pass
12
//@ aux-build: cross-crate-2.rs
23

34
extern crate cross_crate_2;
45

56
use cross_crate_2::Foo;
67

78
fn main() {
8-
// There is an error in the aux crate but there is no way to annotate this
99
Foo::<7>::new();
1010
}

tests/ui/const-generics/generic_const_exprs/cross-crate-2.stderr

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/ui/generic-const-items/trivially-unsatisfied-bounds-0.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// Ensure that we check if trivial bounds on const items hold or not.
55

6-
const UNUSABLE: () = () //~ ERROR evaluation of constant value failed
6+
const UNUSABLE: () = ()
77
where
88
String: Copy;
99

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
error[E0080]: evaluation of constant value failed
2-
--> $DIR/trivially-unsatisfied-bounds-0.rs:6:1
3-
|
4-
LL | / const UNUSABLE: () = ()
5-
LL | | where
6-
LL | | String: Copy;
7-
| |_________________^ entering unreachable code
8-
91
error[E0277]: the trait bound `String: Copy` is not satisfied
102
--> $DIR/trivially-unsatisfied-bounds-0.rs:11:13
113
|
@@ -21,7 +13,6 @@ LL | where
2113
LL | String: Copy;
2214
| ^^^^ required by this bound in `UNUSABLE`
2315

24-
error: aborting due to 2 previous errors
16+
error: aborting due to 1 previous error
2517

26-
Some errors have detailed explanations: E0080, E0277.
27-
For more information about an error, try `rustc --explain E0080`.
18+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1+
//@ check-pass
2+
13
#![feature(generic_const_items, trivial_bounds)]
24
#![allow(incomplete_features, dead_code, trivial_bounds)]
35

4-
// FIXME(generic_const_items): This looks like a bug to me. I expected that we wouldn't emit any
5-
// errors. I thought we'd skip the evaluation of consts whose bounds don't hold.
6-
76
const UNUSED: () = ()
87
where
98
String: Copy;
10-
//~^^^ ERROR evaluation of constant value failed
119

1210
fn main() {}

tests/ui/generic-const-items/trivially-unsatisfied-bounds-1.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ where
66
{
77
[(); { let _a: Option<str> = None; 0 }];
88
//~^ ERROR evaluation of constant value failed
9-
//~^^ WARN cannot use constants which depend on trivially-false where clauses
10-
//~| WARN this was previously accepted by the compiler but is being phased out
11-
//~^^^^ WARN cannot use constants which depend on trivially-false where clauses
9+
//~^^ WARN cannot use constants which depend on trivially-false where clauses
1210
//~| WARN this was previously accepted by the compiler but is being phased out
1311
}
1412

tests/ui/layout/uncomputable-due-to-trivial-bounds-ice-135138.stderr

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,6 @@ error[E0080]: evaluation of constant value failed
1414
LL | [(); { let _a: Option<str> = None; 0 }];
1515
| ^^ the type `Option<str>` has an unknown layout
1616

17-
warning: cannot use constants which depend on trivially-false where clauses
18-
--> $DIR/uncomputable-due-to-trivial-bounds-ice-135138.rs:7:10
19-
|
20-
LL | [(); { let _a: Option<str> = None; 0 }];
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22-
|
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 #76200 <https://github.com/rust-lang/rust/issues/76200>
25-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
26-
27-
error: aborting due to 1 previous error; 2 warnings emitted
17+
error: aborting due to 1 previous error; 1 warning emitted
2818

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

0 commit comments

Comments
 (0)