Skip to content

Commit 4408f14

Browse files
committed
bless tests
1 parent d3094bb commit 4408f14

File tree

8 files changed

+79
-85
lines changed

8 files changed

+79
-85
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
//@ check-pass
21
//@ aux-build: cross-crate-2.rs
32

3+
//~? ERROR: inconsistency during normalizing env
4+
//~? ERROR: inconsistency during normalizing env
5+
46
extern crate cross_crate_2;
57

68
use cross_crate_2::Foo;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error: inconsistency during normalizing env `Binder { value: ConstEvaluatable(UnevaluatedConst { def: DefId(20:8 ~ cross_crate_2[bdab]::{impl#0}::{constant#0}), args: [N/#0] }), bound_vars: [] }`, old=Binder { value: ConstEvaluatable(UnevaluatedConst { def: DefId(20:8 ~ cross_crate_2[bdab]::{impl#0}::{constant#0}), args: [N/#0] }), bound_vars: [] }, next=Some(
2+
Binder { value: ConstEvaluatable({const error}), bound_vars: [] },
3+
)
4+
--> $DIR/auxiliary/cross-crate-2.rs:10:5
5+
|
6+
LL | pub fn new() -> Self {
7+
| ^^^^^^^^^^^^^^^^^^^^
8+
9+
error: inconsistency during normalizing env `Binder { value: TraitPredicate(<[u8; cross_crate_2::::{impl#0}::{constant#0}] as std::marker::Sized>, polarity:Positive), bound_vars: [] }`, old=Binder { value: TraitPredicate(<[u8; cross_crate_2::::{impl#0}::{constant#0}] as std::marker::Sized>, polarity:Positive), bound_vars: [] }, next=Some(
10+
Binder { value: TraitPredicate(<[u8; {const error}] as std::marker::Sized>, polarity:Positive), bound_vars: [] },
11+
)
12+
--> $DIR/auxiliary/cross-crate-2.rs:10:5
13+
|
14+
LL | pub fn new() -> Self {
15+
| ^^^^^^^^^^^^^^^^^^^^
16+
17+
error: aborting due to 2 previous errors
18+

tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ trait Trait {}
1010
impl<const N: u32> Trait for A<N> {}
1111

1212
impl<const N: u32> Trait for A<N> {}
13+
//~^ ERROR: conflicting implementations of trait
1314

1415
pub fn main() {}

tests/ui/const-generics/generic_const_exprs/unknown-alias-defkind-anonconst-ice-116710.stderr

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ error[E0423]: expected value, found builtin type `u8`
44
LL | struct A<const N: u32 = 1, const M: u32 = u8>;
55
| ^^ not a value
66

7-
error: aborting due to 1 previous error
7+
error[E0119]: conflicting implementations of trait `Trait` for type `A<_>`
8+
--> $DIR/unknown-alias-defkind-anonconst-ice-116710.rs:12:1
9+
|
10+
LL | impl<const N: u32> Trait for A<N> {}
11+
| --------------------------------- first implementation here
12+
LL |
13+
LL | impl<const N: u32> Trait for A<N> {}
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `A<_>`
15+
16+
error: aborting due to 2 previous errors
817

9-
For more information about this error, try `rustc --explain E0423`.
18+
Some errors have detailed explanations: E0119, E0423.
19+
For more information about an error, try `rustc --explain E0119`.

tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr

Lines changed: 20 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -6,94 +6,34 @@ LL | #![feature(const_trait_impl, generic_const_exprs)]
66
|
77
= help: remove one of these features
88

9-
error[E0391]: cycle detected when evaluating type-level constant
10-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
9+
error[E0277]: the trait bound `T: const Trait` is not satisfied
10+
--> $DIR/unsatisfied-const-trait-bound.rs:28:37
1111
|
1212
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
13-
| ^^^^^^^^^^^^^
14-
|
15-
note: ...which requires const-evaluating + checking `accept0::{constant#0}`...
16-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
17-
|
18-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
19-
| ^^^^^^^^^^^^^
20-
note: ...which requires checking if `accept0::{constant#0}` is a trivial const...
21-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
22-
|
23-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
24-
| ^^^^^^^^^^^^^
25-
note: ...which requires building MIR for `accept0::{constant#0}`...
26-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
27-
|
28-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
29-
| ^^^^^^^^^^^^^
30-
note: ...which requires building an abstract representation for `accept0::{constant#0}`...
31-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
32-
|
33-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
34-
| ^^^^^^^^^^^^^
35-
note: ...which requires building THIR for `accept0::{constant#0}`...
36-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
37-
|
38-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
39-
| ^^^^^^^^^^^^^
40-
note: ...which requires type-checking `accept0::{constant#0}`...
41-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
42-
|
43-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
44-
| ^^^^^^^^^^^^^
45-
= note: ...which again requires evaluating type-level constant, completing the cycle
46-
note: cycle used when checking that `accept0` is well-formed
47-
--> $DIR/unsatisfied-const-trait-bound.rs:28:35
48-
|
49-
LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
50-
| ^^^^^^^^^^^^^
51-
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
13+
| ^
5214

53-
error[E0391]: cycle detected when checking if `accept1::{constant#0}` is a trivial const
54-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
55-
|
56-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
57-
| ^^^^^^^^^^^^^
58-
|
59-
note: ...which requires building MIR for `accept1::{constant#0}`...
60-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
15+
error[E0277]: the trait bound `T: const Trait` is not satisfied
16+
--> $DIR/unsatisfied-const-trait-bound.rs:32:51
6117
|
6218
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
63-
| ^^^^^^^^^^^^^
64-
note: ...which requires building an abstract representation for `accept1::{constant#0}`...
65-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
66-
|
67-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
68-
| ^^^^^^^^^^^^^
69-
note: ...which requires building THIR for `accept1::{constant#0}`...
70-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
71-
|
72-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
73-
| ^^^^^^^^^^^^^
74-
note: ...which requires type-checking `accept1::{constant#0}`...
75-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
19+
| ^
20+
21+
error[E0277]: the trait bound `Ty: const Trait` is not satisfied
22+
--> $DIR/unsatisfied-const-trait-bound.rs:21:15
7623
|
77-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
78-
| ^^^^^^^^^^^^^
79-
note: ...which requires evaluating type-level constant...
80-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
24+
LL | require::<Ty>();
25+
| ^^
8126
|
82-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
83-
| ^^^^^^^^^^^^^
84-
note: ...which requires const-evaluating + checking `accept1::{constant#0}`...
85-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
27+
note: required by a bound in `require`
28+
--> $DIR/unsatisfied-const-trait-bound.rs:8:15
8629
|
87-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
88-
| ^^^^^^^^^^^^^
89-
= note: ...which again requires checking if `accept1::{constant#0}` is a trivial const, completing the cycle
90-
note: cycle used when const-evaluating + checking `accept1::{constant#0}`
91-
--> $DIR/unsatisfied-const-trait-bound.rs:32:49
30+
LL | fn require<T: const Trait>() {}
31+
| ^^^^^^^^^^^ required by this bound in `require`
32+
help: make the `impl` of trait `Trait` `const`
9233
|
93-
LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
94-
| ^^^^^^^^^^^^^
95-
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
34+
LL | impl const Trait for Ty {
35+
| +++++
9636

97-
error: aborting due to 3 previous errors
37+
error: aborting due to 4 previous errors
9838

99-
For more information about this error, try `rustc --explain E0391`.
39+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error: inconsistency during normalizing env `Binder { value: TraitPredicate(<<T as Trait>::Assoc as Trait>, polarity:Positive), bound_vars: [] }`, old=Binder { value: TraitPredicate(<T as Trait>, polarity:Positive), bound_vars: [] }, next=None
2+
--> $DIR/normalize-param-env-4.rs:16:1
3+
|
4+
LL | / fn foo<T>()
5+
LL | |
6+
LL | |
7+
LL | | where
8+
LL | | <T as Trait>::Assoc: Trait,
9+
| |_______________________________^
10+
11+
error: inconsistency during normalizing env `Binder { value: TraitPredicate(<<T as Trait>::Assoc as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }`, old=Binder { value: TraitPredicate(<T as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }, next=None
12+
--> $DIR/normalize-param-env-4.rs:16:1
13+
|
14+
LL | / fn foo<T>()
15+
LL | |
16+
LL | |
17+
LL | | where
18+
LL | | <T as Trait>::Assoc: Trait,
19+
| |_______________________________^
20+
21+
error: aborting due to 2 previous errors
22+

tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc: Trait`
2-
--> $DIR/normalize-param-env-4.rs:19:26
2+
--> $DIR/normalize-param-env-4.rs:20:26
33
|
44
LL | <T as Trait>::Assoc: Trait,
55
| ^^^^^

tests/ui/traits/next-solver/normalize/normalize-param-env-4.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
//@ ignore-compare-mode-next-solver (explicit revisions)
33
//@[next] compile-flags: -Znext-solver
44
//@[next] known-bug: #92505
5-
//@[current] check-pass
65

76
trait Trait {
87
type Assoc;
@@ -15,6 +14,8 @@ impl<T> Trait for T {
1514
fn impls_trait<T: Trait>() {}
1615

1716
fn foo<T>()
17+
//[current]~^ ERROR: inconsistency during normalizing env
18+
//[current]~| ERROR: inconsistency during normalizing env
1819
where
1920
<T as Trait>::Assoc: Trait,
2021
{

0 commit comments

Comments
 (0)