-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Implement MIR const trait stability checks #136055
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 |
This comment has been minimized.
This comment has been minimized.
7081449
to
65c9b8a
Compare
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.
This looks great, thanks! Just some minor comments.
const_eval_unmarked_const_fn_exposed = `{$def_path}` cannot be (indirectly) exposed to stable | ||
.help = either mark the callee as `#[rustc_const_stable_indirect]`, or the caller as `#[rustc_const_unstable]` | ||
const_eval_unmarked_const_item_exposed = `{$def_path}` cannot be (indirectly) exposed to stable | ||
.help = either mark the item as `#[rustc_const_stable_indirect]`, or the caller as `#[rustc_const_unstable]` |
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.
This is ambiguous about which item should be marked as such -- the caller or the callee.
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.
I'll revert it back to callee since a trait can also be called the callee.
@@ -694,6 +695,88 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { | |||
} | |||
}; | |||
|
|||
let check_stability = |this: &mut Self, def_id| { |
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.
let check_stability = |this: &mut Self, def_id| { | |
// Check the const stability of the given item (fn or trait). | |
let check_item_stability = |this: &mut Self, def_id| { |
Could this be a proper method or would that duplicate too many arguments?
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.
Then maybe this should be check_callee_stability
as well.
Addresses rust-lang/project-const-traits#16
cc @rust-lang/project-const-traits
r? @RalfJung