Skip to content
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

Merged
merged 3 commits into from May 14, 2019

Conversation

varkor
Copy link
Member

@varkor varkor commented May 10, 2019

Fixes #60704.
Fixes #60650.

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2019
@varkor varkor changed the title Delay span bug const parent Use delay_span_bug for error cases when checking AnonConst parent May 10, 2019
struct Foo<const NUM_BYTES: usize>(pub [u8; NUM_BYTES]);

fn main() {
let _ = Foo::<3>([1, 2, 3]); //~ ERROR type annotations needed
Copy link
Contributor

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?

Copy link
Member Author

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.

@varkor
Copy link
Member Author

varkor commented May 13, 2019

Beta-nominating, because this fixes an ICE on stable/beta that seems like it could happen not uncommonly from a typo.

@varkor varkor added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 13, 2019
@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 13, 2019

📌 Commit 0f792ab has been approved by matthewjasper

@bors
Copy link
Contributor

bors commented May 13, 2019

🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 13, 2019
Centril added a commit to Centril/rust that referenced this pull request May 13, 2019
… r=matthewjasper

Use `delay_span_bug` for error cases when checking `AnonConst` parent

Fixes rust-lang#60704.
Fixes rust-lang#60650.
bors added a commit that referenced this pull request May 14, 2019
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
@bors bors merged commit 0f792ab into rust-lang:master May 14, 2019
@varkor varkor added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 16, 2019
@pnkfelix
Copy link
Member

accepted for beta-backport

@pnkfelix pnkfelix added the beta-accepted Accepted for backporting to the compiler in the beta channel. label May 16, 2019
@pietroalbini pietroalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 17, 2019
@pietroalbini pietroalbini added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 18, 2019
@pietroalbini
Copy link
Member

@varkor the ui/const-generics/cannot-infer-type-for-const-param.rs test still ICEs when backported to beta. Can you prepare a PR backporting the changes to beta yourself before Monday?

@varkor
Copy link
Member Author

varkor commented May 18, 2019

@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.

@pietroalbini
Copy link
Member

@rust-lang/compiler what do you want to do then? Leave out the test?

@oli-obk
Copy link
Contributor

oli-obk commented May 20, 2019

yea, just leave out the test

@pnkfelix
Copy link
Member

for the record: I agree with @oli-obk. Leave out the test.

pietroalbini added a commit to pietroalbini/rust that referenced this pull request May 20, 2019
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)
bors added a commit that referenced this pull request May 20, 2019
[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
@michaelwoerister michaelwoerister removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 23, 2019
@varkor varkor added the F-const_generics `#![feature(const_generics)]` label Oct 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. F-const_generics `#![feature(const_generics)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
8 participants