-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Clean up special function const checks #90273
Conversation
I'm not very familiar with this code, but it looks like rustc_do_not_const_check also disables post-drop elaboration checking, but this doesn't add extra checks to that code in an obvious way, so maybe this has an unintended side effect of disabling that checking? |
This comment has been minimized.
This comment has been minimized.
|
Mark them as const and `#[rustc_do_not_const_check]` instead of hard-coding them in const-eval checks.
// We certainly do *not* want to actually call the fn | ||
// though, so be sure we return here. | ||
throw_unsup_format!("calling non-const function `{}`", instance) |
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.
Please remove the is_const_fn
local and put this inside the block that sets it to true
, since all the hooked fns are now const
, we don't need to pass this as a parameter.
I added this because I needed to use |
r? @fee1-dead |
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.
LGTM! Thanks!
@bors r+ |
📌 Commit 223f580 has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (dd757b9): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Mark them as const and
#[rustc_do_not_const_check]
instead of hard-coding them in const-eval checks.r? @oli-obk
@rustbot label A-const-eval T-compiler