Uh oh!
There was an error while loading. Please reload this page.
Implement proper stability check for const impl Trait, fall back to unstable const when undeclared - #97177
Conversation
This avoids an ambiguity (when reading) where `.level.is_stable()` is not immediately clear whether it is general stability or const stability.
Rather than deferring to const eval for checking if a trait is const, we now check up-front. This allows the error to be emitted earlier, notably at the same time as other stability checks. Also included in this commit is a change of the default const stability level to UNstable. Previously, an item that was `const` but did not explicitly state it was unstable was implicitly stable.
This alters the diagnostics a bit, as the trait method is still stable. The only thing this check does is ensure that compilation fails if a trait implementation is declared const-stable.
rust-highfive
commented
May 19, 2022
Some changes occurred in cc @camelid |
rust-highfive
commented
May 19, 2022
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
jhpratt
commented
May 19, 2022
Well, that's good to know at least! It's been a little bit since I've looked at this change, but I'll look over your additions soon. |
davidtwco
left a comment
There was a problem hiding this comment.
r=me unless jhpratt has feedback
jhpratt
commented
May 20, 2022
LGTM. @bors r=davidtwco |
bors
commented
May 20, 2022
@jhpratt: 🔑 Insufficient privileges: Not in reviewers |
davidtwco
commented
May 20, 2022
@bors r+ |
bors
commented
May 20, 2022
📌 Commit f9c4f2b has been approved by |
bors
commented
May 22, 2022
bors
commented
May 22, 2022
☀️ Test successful - checks-actions |
rust-timer
commented
May 22, 2022
Finished benchmarking commit (acfd327): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesThis benchmark run did not return any relevant results for this metric. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
Continuation of #93960
@jhpratt it looks to me like the test was simply not testing for the failure you were looking for? Your checks actually do the right thing for const traits?