Skip to content

Use delay_span_bug for error cases when checking AnonConst parent - #60710

Merged
bors merged 3 commits into
rust-lang:masterfrom
varkor:delay_span_bug-const-parent
May 14, 2019
Merged

Use delay_span_bug for error cases when checking AnonConst parent#60710
bors merged 3 commits into
rust-lang:masterfrom
varkor:delay_span_bug-const-parent

Conversation

@varkor

Copy link
Copy Markdown
Contributor

Fixes#60704.
Fixes#60650.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @matthewjasper

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 10, 2019
@varkorvarkor changed the title Delay span bug const parentUse delay_span_bug for error cases when checking AnonConst parentMay 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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
ContributorAuthor

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

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

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 13, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 0f792ab has been approved by matthewjasper

@bors

bors commented May 13, 2019

Copy link
Copy Markdown
Collaborator

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

@borsbors 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
Fixesrust-lang#60704.
Fixesrust-lang#60650.
@CentrilCentril mentioned this pull request May 13, 2019
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:masterMay 14, 2019
@varkorvarkor 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
Copy Markdown
Contributor

accepted for beta-backport

@pnkfelixpnkfelix added the beta-accepted Accepted for backporting to the compiler in the beta channel. label May 16, 2019
@emilyalbiniemilyalbini mentioned this pull request May 17, 2019
@emilyalbiniemilyalbini removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 17, 2019
@emilyalbiniemilyalbini added the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 18, 2019
@emilyalbini

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@emilyalbini

Copy link
Copy Markdown
Member

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

@oli-obk

Copy link
Copy Markdown
Contributor

yea, just leave out the test

@pnkfelix

Copy link
Copy Markdown
Contributor

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

emilyalbini added a commit to emilyalbini/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
@michaelwoeristermichaelwoerister removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 23, 2019
@varkorvarkor added the F-const_generics `#![feature(const_generics)]` label Oct 19, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-acceptedAccepted for backporting to the compiler in the beta channel.F-const_generics`#![feature(const_generics)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

8 participants

@varkor@rust-highfive@matthewjasper@bors@pnkfelix@emilyalbini@oli-obk@michaelwoerister