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

Nightly compiler error regression for struct array field #40749

Closed
nickbabcock opened this issue Mar 22, 2017 · 2 comments
Closed

Nightly compiler error regression for struct array field #40749

nickbabcock opened this issue Mar 22, 2017 · 2 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@nickbabcock
Copy link
Contributor

The following code produces a compiler error (as expected) on stable, but the compiler crashes on nightly.

pub struct ChunkIterator {
    buf: [u8; 10],
}

impl ChunkIterator {
    pub fn new() {
        ChunkIterator {
            buf: [0; ..10],
        }
    }
}

On stable:

error[E0308]: mismatched types
 --> <anon>:8:22
  |
8 |             buf: [0; ..10],
  |                      ----
  |                      |
  |                      expected usize, found struct `std::ops::RangeTo`
  |                      in this macro invocation
  |
  = note: expected type `usize`
             found type `std::ops::RangeTo<{integer}>`

On nightly:

error: internal compiler error: /checkout/src/librustc/hir/map/mod.rs:379: local_def_id: no entry for `22`, which has a map of `Some(EntryExpr(NodeId(20), expr(22: ::std::ops::RangeTo{end: 10,})))`
@arielb1 arielb1 added regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 23, 2017
@arielb1
Copy link
Contributor

arielb1 commented Mar 23, 2017

Also in beta=1.17.

@brson brson added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Mar 23, 2017
@nikomatsakis
Copy link
Contributor

@brson brson added the P-high High priority label Mar 23, 2017
arielb1 added a commit to arielb1/rust that referenced this issue Mar 23, 2017
When the Range expression is the root of a constant, its node-id is
used for the def-id of the body, so it has to be preserved in the AST ->
HIR lowering.

Fixes rust-lang#40749.
alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 25, 2017
keep the AST node-id when lowering ExprKind::Range

When the Range expression is the root of a constant, its node-id is
used for the def-id of the body, so it has to be preserved in the AST ->
HIR lowering.

Fixes rust-lang#40749.

r? @eddyb
beta-nominating because regression
bors added a commit that referenced this issue Mar 27, 2017
keep the AST node-id when lowering ExprKind::Range

When the Range expression is the root of a constant, its node-id is
used for the def-id of the body, so it has to be preserved in the AST ->
HIR lowering.

Fixes #40749.

r? @eddyb
beta-nominating because regression
arielb1 added a commit to arielb1/rust that referenced this issue Apr 2, 2017
When the Range expression is the root of a constant, its node-id is
used for the def-id of the body, so it has to be preserved in the AST ->
HIR lowering.

Fixes rust-lang#40749.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants