@@ -2628,15 +2628,12 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
26282628 }
26292629 ast:: ExprVec ( ref args, mutbl) => {
26302630 let tt = ast_expr_vstore_to_vstore ( fcx, ev, vst) ;
2631- let mutability;
26322631 let mut any_error = false ;
26332632 let mut any_bot = false ;
2634- match vst {
2635- ast:: ExprVstoreMutBox | ast:: ExprVstoreMutSlice => {
2636- mutability = ast:: MutMutable
2637- }
2638- _ => mutability = mutbl
2639- }
2633+ let mutability = match vst {
2634+ ast:: ExprVstoreMutSlice => ast:: MutMutable ,
2635+ _ => mutbl,
2636+ } ;
26402637 let t: ty:: t = fcx. infcx ( ) . next_ty_var ( ) ;
26412638 for e in args. iter ( ) {
26422639 check_expr_has_type ( fcx, * e, t) ;
@@ -2650,11 +2647,9 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
26502647 }
26512648 if any_error {
26522649 ty:: mk_err ( )
2653- }
2654- else if any_bot {
2650+ } else if any_bot {
26552651 ty:: mk_bot ( )
2656- }
2657- else {
2652+ } else {
26582653 ty:: mk_evec ( tcx, ty:: mt { ty : t, mutbl : mutability} , tt)
26592654 }
26602655 }
@@ -2663,10 +2658,8 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
26632658 let _ = ty:: eval_repeat_count ( fcx, count_expr) ;
26642659 let tt = ast_expr_vstore_to_vstore ( fcx, ev, vst) ;
26652660 let mutability = match vst {
2666- ast:: ExprVstoreMutBox | ast:: ExprVstoreMutSlice => {
2667- ast:: MutMutable
2668- }
2669- _ => mutbl
2661+ ast:: ExprVstoreMutSlice => ast:: MutMutable ,
2662+ _ => mutbl,
26702663 } ;
26712664 let t: ty:: t = fcx. infcx ( ) . next_ty_var ( ) ;
26722665 check_expr_has_type ( fcx, element, t) ;
@@ -2741,7 +2734,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
27412734 ast:: ExprUnary ( callee_id, unop, oprnd) => {
27422735 let exp_inner = unpack_expected ( fcx, expected, |sty| {
27432736 match unop {
2744- ast:: UnBox ( _ ) | ast:: UnUniq => match * sty {
2737+ ast:: UnBox | ast:: UnUniq => match * sty {
27452738 ty:: ty_box( ty) => Some ( ty) ,
27462739 ty:: ty_uniq( ref mt) => Some ( mt. ty ) ,
27472740 _ => None
@@ -2755,7 +2748,7 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt,
27552748 if !ty:: type_is_error ( oprnd_t) &&
27562749 !ty:: type_is_bot ( oprnd_t) {
27572750 match unop {
2758- ast:: UnBox ( _ ) => {
2751+ ast:: UnBox => {
27592752 oprnd_t = ty:: mk_box ( tcx, oprnd_t)
27602753 }
27612754 ast:: UnUniq => {
@@ -3920,7 +3913,7 @@ pub fn ast_expr_vstore_to_vstore(fcx: @FnCtxt,
39203913 -> ty:: vstore {
39213914 match v {
39223915 ast:: ExprVstoreUniq => ty:: vstore_uniq,
3923- ast:: ExprVstoreBox | ast :: ExprVstoreMutBox => ty:: vstore_box,
3916+ ast:: ExprVstoreBox => ty:: vstore_box,
39243917 ast:: ExprVstoreSlice | ast:: ExprVstoreMutSlice => {
39253918 let r = fcx. infcx ( ) . next_region_var ( infer:: AddrOfSlice ( e. span ) ) ;
39263919 ty:: vstore_slice ( r)
0 commit comments