@@ -6,30 +6,134 @@ 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:29:37
9+ error[E0391 ]: cycle detected when evaluating type-level constant
10+ --> $DIR/unsatisfied-const-trait-bound.rs:29: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:29:35
17+ |
18+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
19+ | ^^^^^^^^^^^^^
20+ note: ...which requires caching mir of `accept0::{constant#0}` for CTFE...
21+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
22+ |
23+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
24+ | ^^^^^^^^^^^^^
25+ note: ...which requires elaborating drops for `accept0::{constant#0}`...
26+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
27+ |
28+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
29+ | ^^^^^^^^^^^^^
30+ note: ...which requires borrow-checking `accept0::{constant#0}`...
31+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
32+ |
33+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
34+ | ^^^^^^^^^^^^^
35+ note: ...which requires promoting constants in MIR for `accept0::{constant#0}`...
36+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
37+ |
38+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
39+ | ^^^^^^^^^^^^^
40+ note: ...which requires const checking `accept0::{constant#0}`...
41+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
42+ |
43+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
44+ | ^^^^^^^^^^^^^
45+ note: ...which requires building MIR for `accept0::{constant#0}`...
46+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
47+ |
48+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
49+ | ^^^^^^^^^^^^^
50+ note: ...which requires building an abstract representation for `accept0::{constant#0}`...
51+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
52+ |
53+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
54+ | ^^^^^^^^^^^^^
55+ note: ...which requires building THIR for `accept0::{constant#0}`...
56+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
57+ |
58+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
59+ | ^^^^^^^^^^^^^
60+ note: ...which requires type-checking `accept0::{constant#0}`...
61+ --> $DIR/unsatisfied-const-trait-bound.rs:29:35
62+ |
63+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
64+ | ^^^^^^^^^^^^^
65+ = note: ...which again requires evaluating type-level constant, completing the cycle
66+ note: cycle used when checking that `accept0` is well-formed
67+ --> $DIR/unsatisfied-const-trait-bound.rs:29:1
68+ |
69+ LL | fn accept0<T: Trait>(_: Container<{ T::make() }>) {}
70+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71+ = 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
1472
15- error[E0277 ]: the trait bound `T: const Trait` is not satisfied
16- --> $DIR/unsatisfied-const-trait-bound.rs:33:50
73+ error[E0391 ]: cycle detected when caching mir of `accept1::{constant#0}` for CTFE
74+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
1775 |
1876LL | 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:22:15
77+ | ^^^^^^^^^^^^^
78+ |
79+ note: ...which requires elaborating drops for `accept1::{constant#0}`...
80+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
81+ |
82+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
83+ | ^^^^^^^^^^^^^
84+ note: ...which requires borrow-checking `accept1::{constant#0}`...
85+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
86+ |
87+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
88+ | ^^^^^^^^^^^^^
89+ note: ...which requires promoting constants in MIR for `accept1::{constant#0}`...
90+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
91+ |
92+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
93+ | ^^^^^^^^^^^^^
94+ note: ...which requires const checking `accept1::{constant#0}`...
95+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
96+ |
97+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
98+ | ^^^^^^^^^^^^^
99+ note: ...which requires building MIR for `accept1::{constant#0}`...
100+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
23101 |
24- LL | require::<Ty>();
25- | ^^
102+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
103+ | ^^^^^^^^^^^^^
104+ note: ...which requires building an abstract representation for `accept1::{constant#0}`...
105+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
106+ |
107+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
108+ | ^^^^^^^^^^^^^
109+ note: ...which requires building THIR for `accept1::{constant#0}`...
110+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
26111 |
27- note: required by a bound in `require`
28- --> $DIR/unsatisfied-const-trait-bound.rs:8:15
112+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
113+ | ^^^^^^^^^^^^^
114+ note: ...which requires type-checking `accept1::{constant#0}`...
115+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
116+ |
117+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
118+ | ^^^^^^^^^^^^^
119+ note: ...which requires evaluating type-level constant...
120+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
29121 |
30- LL | fn require<T: const Trait>() {}
31- | ^^^^^^^^^^^ required by this bound in `require`
122+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
123+ | ^^^^^^^^^^^^^
124+ note: ...which requires const-evaluating + checking `accept1::{constant#0}`...
125+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
126+ |
127+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
128+ | ^^^^^^^^^^^^^
129+ = note: ...which again requires caching mir of `accept1::{constant#0}` for CTFE, completing the cycle
130+ note: cycle used when const-evaluating + checking `accept1::{constant#0}`
131+ --> $DIR/unsatisfied-const-trait-bound.rs:33:48
132+ |
133+ LL | const fn accept1<T: ~const Trait>(_: Container<{ T::make() }>) {}
134+ | ^^^^^^^^^^^^^
135+ = 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
32136
33- error: aborting due to 4 previous errors
137+ error: aborting due to 3 previous errors
34138
35- For more information about this error, try `rustc --explain E0277 `.
139+ For more information about this error, try `rustc --explain E0391 `.
0 commit comments