@@ -141,7 +141,7 @@ fn const_deref(cx: &CrateContext, v: ValueRef, t: ty::t, explicit: bool)
141141 let dv = match ty:: get ( t) . sty {
142142 ty:: ty_ptr( mt) | ty:: ty_rptr( _, mt) => {
143143 match ty:: get ( mt. ty ) . sty {
144- ty:: ty_vec( _, None ) | ty:: ty_str( None ) => cx. sess ( ) . bug ( "unexpected slice" ) ,
144+ ty:: ty_vec( _, None ) | ty:: ty_str => cx. sess ( ) . bug ( "unexpected slice" ) ,
145145 _ => const_deref_ptr ( cx, v) ,
146146 }
147147 }
@@ -434,7 +434,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
434434 let ( arr, len) = match ty:: get ( bt) . sty {
435435 ty:: ty_vec( _, Some ( u) ) => ( bv, C_uint ( cx, u) ) ,
436436 ty:: ty_rptr( _, mt) => match ty:: get ( mt. ty ) . sty {
437- ty:: ty_vec( _, None ) | ty:: ty_str( None ) => {
437+ ty:: ty_vec( _, None ) | ty:: ty_str => {
438438 let e1 = const_get_elt ( cx, bv, [ 0 ] ) ;
439439 ( const_deref_ptr ( cx, e1) , const_get_elt ( cx, bv, [ 1 ] ) )
440440 } ,
@@ -448,16 +448,12 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
448448 let len = llvm:: LLVMConstIntGetZExtValue ( len) as u64 ;
449449 let len = match ty:: get ( bt) . sty {
450450 ty:: ty_uniq( ty) | ty:: ty_rptr( _, ty:: mt { ty, ..} ) => match ty:: get ( ty) . sty {
451- ty:: ty_str( None ) => {
451+ ty:: ty_str => {
452452 assert ! ( len > 0 ) ;
453453 len - 1
454454 }
455455 _ => len
456456 } ,
457- ty:: ty_str( Some ( _) ) => {
458- assert ! ( len > 0 ) ;
459- len - 1
460- } ,
461457 _ => len
462458 } ;
463459 if iv >= len {
0 commit comments