Skip to content

Commit afc598e

Browse files
committed
rustc_const_eval: strings are not indexable in Rust 1.x.
1 parent b6ce2aa commit afc598e

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/librustc_const_eval/eval.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,9 +856,6 @@ pub fn eval_const_expr_partial<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
856856
Integral(U8(data[idx as usize]))
857857
},
858858

859-
Str(ref s) if idx as usize >= s.len() => signal!(e, IndexOutOfBounds),
860-
// FIXME: return a const char
861-
Str(_) => signal!(e, UnimplementedConstVal("indexing into str")),
862859
_ => signal!(e, IndexedNonVec),
863860
}
864861
}

0 commit comments

Comments
 (0)