Skip to content

Commit

Permalink
rustc_const_eval: strings are not indexable in Rust 1.x.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Jun 5, 2016
1 parent b6ce2aa commit afc598e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/librustc_const_eval/eval.rs
Expand Up @@ -856,9 +856,6 @@ pub fn eval_const_expr_partial<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
Integral(U8(data[idx as usize]))
},

Str(ref s) if idx as usize >= s.len() => signal!(e, IndexOutOfBounds),
// FIXME: return a const char
Str(_) => signal!(e, UnimplementedConstVal("indexing into str")),
_ => signal!(e, IndexedNonVec),
}
}
Expand Down

0 comments on commit afc598e

Please sign in to comment.