-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix ICE with const generic param in struct #59355
Conversation
if let Some(Rib { kind: FnItemRibKind, .. }) = ribs.peek() { | ||
// When declaring const parameters inside function signatures, the first rib | ||
// is always a `FnItemRibKind`. In this case, we can skip it, to avoid it | ||
// (spuriously) conflicting with the const param. |
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.
Could you give an example of "spuriously conflicting with the const param"? Is there a test?
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.
Any function definition with a const generic parameter would conflict. E.g.
rust/src/test/ui/const-generics/const-expression-parameter.rs
Lines 4 to 6 in f94f85b
fn i32_identity<const X: i32>() -> i32 { | |
5 | |
} |
One significant question (#59355 (comment)), otherwise r=me. |
@bors r+ rollup |
📌 Commit 5032643 has been approved by |
…trochenkov Fix ICE with const generic param in struct Fixes rust-lang#59340. r? @petrochenkov
Rollup of 7 pull requests Successful merges: - #59213 (Track changes to robots.txt) - #59239 (Remove inline assembly from hint::spin_loop) - #59251 (Use a valid name for graphviz graphs) - #59296 (Do not encode gensymed imports in metadata) - #59328 (Implement specialized nth_back() for Box and Windows.) - #59355 (Fix ICE with const generic param in struct) - #59377 (Correct minimum system LLVM version in tests)
Fixes #59340.
r? @petrochenkov