-
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
Validate rustc_args_required_const
#77343
Validate rustc_args_required_const
#77343
Conversation
r? @lcnr (rust_highfive has picked a reviewer for you, use r? to override) |
cecc871
to
d40e652
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.
a small nit, otherwise LGTM
d40e652
to
5156c2b
Compare
if let Some(item) = item { | ||
match &item.kind { | ||
ItemKind::Fn(sig, ..) => { | ||
if val >= sig.decl.inputs.len() as u128 { |
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 a really deep indentation,
Can you convert some branches into early exists instead?
r=me after that
I've just noticed this isn't validating foreign functions properly; I'll fix that soon. |
@varkor a PR by @davidtwco will make this obsolete, so it's fine to merge this without checks on extern functions as #77015 will add them automatically |
5156c2b
to
ebba2a4
Compare
I took a look at that PR, but it didn't seem to cover this case. I've fixed the handling of |
ebba2a4
to
609786d
Compare
Yeah, mixed something up here, #77015 looks at variants, the problem with extern items is something else I recently interacted with (https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/visit.20.60ForeignItem.60s.20in.20.60ItemLikeVisitor.60/near/210605191) LGTM @bors r+ |
📌 Commit 609786d has been approved by |
…lidation, r=lcnr Validate `rustc_args_required_const` Fixes rust-lang#74608.
Rollup of 12 pull requests Successful merges: - rust-lang#76909 (Add Iterator::advance_by and DoubleEndedIterator::advance_back_by) - rust-lang#77153 (Fix recursive nonterminal expansion during pretty-print/reparse check) - rust-lang#77202 (Defer Apple SDKROOT detection to link time.) - rust-lang#77303 (const evaluatable: improve `TooGeneric` handling) - rust-lang#77305 (move candidate_from_obligation_no_cache) - rust-lang#77315 (Rename AllocErr to AllocError) - rust-lang#77319 (Stable hashing: add comments and tests concerning platform-independence) - rust-lang#77324 (Don't fire `const_item_mutation` lint on writes through a pointer) - rust-lang#77343 (Validate `rustc_args_required_const`) - rust-lang#77349 (Update cargo) - rust-lang#77360 (References to ZSTs may be at arbitrary aligned addresses) - rust-lang#77371 (Remove trailing space in error message) Failed merges: r? `@ghost`
Fixes #74608.