@@ -6,34 +6,94 @@ LL | #![feature(const_trait_impl, generic_const_exprs)]
66 |
77 = help: remove one of these features
88
9- error[E0277 ]: the trait bound `T: const Trait` is not satisfied
10- --> $DIR/unsatisfied-const-trait-bound.rs:28:37
9+ error[E0391 ]: cycle detected when evaluating type-level constant
10+ --> $DIR/unsatisfied-const-trait-bound.rs:28:35
1111 |
1212LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
13- | ^
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
1452
15- error[E0277 ]: the trait bound `T: const Trait` is not satisfied
16- --> $DIR/unsatisfied-const-trait-bound.rs:32:51
53+ error[E0391 ]: cycle detected when checking if `accept1::{constant#0}` is a trivial const
54+ --> $DIR/unsatisfied-const-trait-bound.rs:32:49
1755 |
1856LL | const fn accept1<T: [const] Trait>(_: Container<{ T::make() }>) {}
19- | ^
20-
21- error[E0277]: the trait bound `Ty: const Trait` is not satisfied
22- --> $DIR/unsatisfied-const-trait-bound.rs:21:15
57+ | ^^^^^^^^^^^^^
2358 |
24- LL | require::<Ty>();
25- | ^^
59+ note: ...which requires building MIR for `accept1::{constant#0}`...
60+ --> $DIR/unsatisfied-const-trait-bound.rs:32:49
2661 |
27- note: required by a bound in `require`
28- --> $DIR/unsatisfied-const-trait-bound.rs:8:15
62+ 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
2966 |
30- LL | fn require<T: const Trait>() {}
31- | ^^^^^^^^^^^ required by this bound in `require`
32- help: make the `impl` of trait `Trait` `const`
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
3371 |
34- LL | impl const Trait for Ty {
35- | +++++
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
76+ |
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
81+ |
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
86+ |
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
92+ |
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
3696
37- error: aborting due to 4 previous errors
97+ error: aborting due to 3 previous errors
3898
39- For more information about this error, try `rustc --explain E0277 `.
99+ For more information about this error, try `rustc --explain E0391 `.
0 commit comments