-
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
Use delay_span_bug
for error cases when checking AnonConst
parent
#60710
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
delay_span_bug
for error cases when checking AnonConst
parent
struct Foo<const NUM_BYTES: usize>(pub [u8; NUM_BYTES]); | ||
|
||
fn main() { | ||
let _ = Foo::<3>([1, 2, 3]); //~ ERROR type annotations needed |
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.
What happens if this is replaced with 3usize
?
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.
Unfortunately, it ICEs:
src/librustc_codegen_llvm/context.rs:862: failed to get layout for `[type error]`: the type `[type error]` has an unknown layout
I think this is probably a result of the existing issues with const generics and arrays. I'll add the updated test as a new issue.
Beta-nominating, because this fixes an ICE on stable/beta that seems like it could happen not uncommonly from a typo. |
@bors r+ |
📌 Commit 0f792ab has been approved by |
🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened |
… r=matthewjasper Use `delay_span_bug` for error cases when checking `AnonConst` parent Fixes rust-lang#60704. Fixes rust-lang#60650.
Rollup of 5 pull requests Successful merges: - #60176 (Explain error when yielding a reference to a local variable) - #60201 (coretest: Downgrade deny to warn) - #60562 (Add #[doc(hidden)] attribute on compiler generated module.) - #60710 (Use `delay_span_bug` for error cases when checking `AnonConst` parent) - #60770 (add impl_trait_in_bindings to INCOMPLETE_FEATURES) Failed merges: r? @ghost
accepted for beta-backport |
@varkor the |
@pietroalbini: I will try, but it might be okay just to leave that test out entirely, as it only occurs under the feature flag, which can't be enabled on beta. |
@rust-lang/compiler what do you want to do then? Leave out the test? |
yea, just leave out the test |
for the record: I agree with @oli-obk. Leave out the test. |
The test is failing on 1.35.0 stable but that's not important since the ICE happens only with the feature gate enabled, thus it doesn't affect stable. rust-lang#60710 (comment)
[stable] Rust 1.35.0 stable release This also cherry-picks this beta backport: * #60710: Use `delay_span_bug` for error cases when checking `AnonConst` parent r? @ghost cc @Mark-Simulacrum @rust-lang/release
Fixes #60704.
Fixes #60650.