-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
require trait impls to have matching const stabilities as the traits #136688
base: master
Are you sure you want to change the base?
Conversation
Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval |
5d0388e
to
caeb62a
Compare
This comment has been minimized.
This comment has been minimized.
caeb62a
to
23cee74
Compare
The corresponding check for regular stability seems to work very differently -- do we have any idea why? I get
|
Anyway I agree with the goal but would prefer if someone else could review the implementation -- @compiler-errors or @oli-obk , could one of you take this? |
Can do |
hi @compiler-errors :)) |
☔ The latest upstream changes (presumably #135726) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me after rebasing
&& const_stab.is_some_and(|(stab, _)| stab.is_const_stable()) | ||
{ | ||
self.tcx.dcx().emit_err(errors::TraitImplConstStable { span: item.span }); | ||
if features.const_trait_impl() && hir::Constness::Const == *constness { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: inconsistency between ==
here but if let
below for matching constness. can you choose one?
This resolves rust-lang/project-const-traits#5 by implementing the suggested solution in the given thread
r? @RalfJung
cc @rust-lang/project-const-traits