You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ICE: RangeInclusive broken in nightly-2018-05-02? #50415
fnmain(){let full_length = 1024;let range = {// do some stuff, omit hereNone};let range = range.map(|(s, t)| s..=t).unwrap_or(0..=(full_length-1));println!("{:?}", range);}
Which expected prints 0..=1023(work fine under beta channel), while, I got ICE:
error: internal compiler error: librustc/hir/map/mod.rs:329: local_def_id: no entry for `25`, which has a map of `Some(EntryTy(NodeId(71), 3, type(::std::ops::RangeInclusive)))`
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));
Activity
emilyalbini commentedon May 3, 2018
Thanks for reporting this, indeed it works on beta and fails on nightly. Bisected the cause: #49724 cc @kennytm @Kimundi
kennytm commentedon May 3, 2018
Fully simplified:
-Z unpretty=hir,identified
Stack trace
kennytm commentedon May 3, 2018
It seems this fixed it? Is this a correct change?
Fix issue rust-lang#50415.
nikomatsakis commentedon May 3, 2018
triage: P-high