-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
ICE: RangeInclusive broken in nightly-2018-05-02? #50415
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-high
High priority
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Comments
pietroalbini
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
May 3, 2018
Fully simplified: fn main() {
let _ = || 0..=1;
} -Z unpretty=hir,identified#[prelude_import]
use std::prelude::v1::*; /* node_id: 2 hir local_id: 0 */
#[macro_use]
extern crate std; /* node_id: 3 hir local_id: 0 */
fn main() ({
let _ /* pat node_id: 8 hir local_id: 2 */ =
(||
((<::std::ops::RangeInclusive>::new /*
node_id: 14 hir local_id: 6
*/)((0 /* node_id: 9 hir local_id: 4 */),
(1 /* node_id: 10 hir local_id: 5 */)) /*
node_id: 11 hir local_id: 3
*/) /* node_id: 12 hir local_id: 7 */);
} /* block node_id: 6 hir local_id: 9 */ /*
node_id: 15 hir local_id: 10 */) /* node_id: 4 hir local_id: 0
*/ Stack trace
|
It seems this fixed it? Is this a correct change? diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs
index 196f787998..64333a8957 100644
--- a/src/librustc/hir/lowering.rs
+++ b/src/librustc/hir/lowering.rs
@@ -3123,7 +3123,7 @@ impl<'a> LoweringContext<'a> {
ExprKind::Range(Some(ref e1), Some(ref e2), RangeLimits::Closed) => {
// FIXME: Use head_sp directly after RangeInclusive::new() is stabilized in stage0.
let span = self.allow_internal_unstable(CompilerDesugaringKind::DotFill, e.span);
- let id = self.lower_node_id(e.id);
+ let id = self.next_id();
let e1 = self.lower_expr(e1);
let e2 = self.lower_expr(e2);
let ty_path = P(self.std_path(span, &["ops", "RangeInclusive"], false)); |
kennytm
added a commit
to kennytm/rust
that referenced
this issue
May 3, 2018
triage: P-high |
kennytm
added a commit
to kennytm/rust
that referenced
this issue
May 3, 2018
…g-range-inclusive-from-closure, r=michaelwoerister Fix ICE when using a..=b in a closure. Fix rust-lang#50415.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
P-high
High priority
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
Which expected prints
0..=1023
(work fine under beta channel), while, I got ICE:playground
The text was updated successfully, but these errors were encountered: