@@ -2564,71 +2564,74 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
2564
2564
let tcx = fcx. ccx. tcx;
2565
2565
let id = expr. id;
2566
2566
match expr. node {
2567
- ast : : ExprVstore ( ev, vst) => {
2568
- let typ = match ev. node {
2569
- ast : : ExprVec ( ref args) => {
2570
- let mutability = match vst {
2571
- ast : : ExprVstoreMutSlice => ast:: MutMutable ,
2572
- _ => ast : : MutImmutable ,
2573
- } ;
2574
- let mut any_error = false ;
2575
- let mut any_bot = false ;
2576
- let t: ty:: t = fcx. infcx( ) . next_ty_var( ) ;
2577
- for e in args. iter( ) {
2578
- check_expr_has_type( fcx, * e, t) ;
2579
- let arg_t = fcx. expr_ty( * e) ;
2580
- if ty:: type_is_error( arg_t) {
2581
- any_error = true ;
2567
+ ast : : ExprVstore ( ev, vst) => {
2568
+ let typ = match ev. node {
2569
+ ast : : ExprVec ( ref args) => {
2570
+ let mutability = match vst {
2571
+ ast : : ExprVstoreMutSlice => ast:: MutMutable ,
2572
+ _ => ast : : MutImmutable ,
2573
+ } ;
2574
+ let mut any_error = false ;
2575
+ let mut any_bot = false ;
2576
+ let t: ty:: t = fcx. infcx( ) . next_ty_var( ) ;
2577
+ for e in args. iter( ) {
2578
+ check_expr_has_type( fcx, * e, t) ;
2579
+ let arg_t = fcx. expr_ty( * e) ;
2580
+ if ty:: type_is_error( arg_t) {
2581
+ any_error = true ;
2582
+ }
2583
+ else if ty:: type_is_bot( arg_t) {
2584
+ any_bot = true ;
2585
+ }
2586
+ }
2587
+ if any_error {
2588
+ ty : : mk_err( )
2589
+ } else if any_bot {
2590
+ ty : : mk_bot( )
2591
+ } else {
2592
+ ast_expr_vstore_to_ty( fcx, ev, vst, ||
2593
+ ty:: mt { ty : ty:: mk_vec( tcx,
2594
+ ty:: mt { ty : t, mutbl : mutability} ,
2595
+ None ) ,
2596
+ mutbl : mutability } )
2597
+ }
2582
2598
}
2583
- else if ty:: type_is_bot( arg_t) {
2584
- any_bot = true ;
2599
+ ast:: ExprRepeat ( element, count_expr) => {
2600
+ check_expr_with_hint( fcx, count_expr, ty:: mk_uint( ) ) ;
2601
+ let _ = ty:: eval_repeat_count ( fcx , count_expr ) ;
2602
+ let mutability = match vst {
2603
+ ast : : ExprVstoreMutSlice => ast:: MutMutable ,
2604
+ _ => ast : : MutImmutable ,
2605
+ } ;
2606
+ let t = fcx. infcx( ) . next_ty_var( ) ;
2607
+ check_expr_has_type( fcx, element, t) ;
2608
+ let arg_t = fcx. expr_ty( element) ;
2609
+ if ty:: type_is_error ( arg_t ) {
2610
+ ty:: mk_err ( )
2611
+ } else if ty:: type_is_bot ( arg_t ) {
2612
+ ty:: mk_bot ( )
2613
+ } else {
2614
+ ast_expr_vstore_to_ty( fcx, ev, vst, ||
2615
+ ty:: mt { ty : ty:: mk_vec( tcx,
2616
+ ty:: mt { ty : t, mutbl : mutability} ,
2617
+ None ) ,
2618
+ mutbl : mutability} )
2619
+ }
2585
2620
}
2586
- }
2587
- if any_error {
2588
- ty : : mk_err( )
2589
- } else if any_bot {
2590
- ty : : mk_bot( )
2591
- } else {
2592
- ast_expr_vstore_to_ty( fcx, ev, vst, ||
2593
- ty:: mt { ty : ty:: mk_vec( tcx,
2594
- ty:: mt { ty : t, mutbl : mutability} ,
2595
- None ) ,
2596
- mutbl : mutability } )
2597
- }
2598
- }
2599
- ast:: ExprRepeat ( element, count_expr) => {
2600
- check_expr_with_hint( fcx, count_expr, ty:: mk_uint( ) ) ;
2601
- let _ = ty:: eval_repeat_count ( fcx , count_expr ) ;
2602
- let mutability = match vst {
2603
- ast : : ExprVstoreMutSlice => ast:: MutMutable ,
2604
- _ => ast : : MutImmutable ,
2621
+ ast:: ExprLit ( _) => {
2622
+ let error = if vst == ast:: ExprVstoreSlice {
2623
+ "`&\" string\" ` has been removed; use `\" string\" ` instead"
2624
+ } else {
2625
+ "`~\" string\" ` has been removed; use `\" string\" .to_owned()` instead"
2626
+ } ;
2627
+ tcx. sess. span_err( expr. span, error) ;
2628
+ ty:: mk_err ( )
2629
+ }
2630
+ _ => tcx. sess. span_bug( expr. span, "vstore modifier on non-sequence" ) ,
2605
2631
} ;
2606
- let t = fcx. infcx( ) . next_ty_var( ) ;
2607
- check_expr_has_type( fcx, element, t) ;
2608
- let arg_t = fcx. expr_ty( element) ;
2609
- if ty:: type_is_error ( arg_t ) {
2610
- ty:: mk_err ( )
2611
- } else if ty:: type_is_bot ( arg_t ) {
2612
- ty:: mk_bot ( )
2613
- } else {
2614
- ast_expr_vstore_to_ty( fcx, ev, vst, ||
2615
- ty:: mt { ty : ty:: mk_vec( tcx,
2616
- ty:: mt { ty : t, mutbl : mutability} ,
2617
- None ) ,
2618
- mutbl : mutability} )
2619
- }
2620
- }
2621
- ast:: ExprLit ( _) => {
2622
- tcx. sess. span_err( expr. span,
2623
- "`~\" string\" ` has been removed; use `\" string\" .to_owned()` \
2624
- instead") ;
2625
- ty:: mk_err ( )
2626
- }
2627
- _ => tcx. sess. span_bug( expr. span, "vstore modifier on non-sequence" ) ,
2628
- } ;
2629
- fcx. write_ty( ev. id, typ) ;
2630
- fcx. write_ty( id, typ) ;
2631
- }
2632
+ fcx. write_ty( ev. id, typ) ;
2633
+ fcx. write_ty( id, typ) ;
2634
+ }
2632
2635
2633
2636
ast:: ExprBox ( place, subexpr) => {
2634
2637
check_expr( fcx, place) ;
9 commit comments
bors commentedon May 1, 2014
saw approval from alexcrichton
at https://github.com/thestinger/rust/commit/e93cb04c4b011088d3b13a17bdf4cb865730dd38
bors commentedon May 1, 2014
merging thestinger/rust/de-tilde-str-vec = e93cb04 into auto
bors commentedon May 1, 2014
thestinger/rust/de-tilde-str-vec = e93cb04 merged ok, testing candidate = e4b8400d
bors commentedon May 1, 2014
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4729
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5525
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5521
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4627
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5623
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4719
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5625
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2512
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5619
bors commentedon May 1, 2014
saw approval from alexcrichton
at https://github.com/thestinger/rust/commit/e93cb04c4b011088d3b13a17bdf4cb865730dd38
bors commentedon May 1, 2014
merging thestinger/rust/de-tilde-str-vec = e93cb04 into auto
bors commentedon May 1, 2014
thestinger/rust/de-tilde-str-vec = e93cb04 merged ok, testing candidate = 9f836d5
bors commentedon May 2, 2014
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5527
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5523
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/4616
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4629
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5625
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4713
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4721
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5627
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/4712
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4718
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/4780
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2514
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5621
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4716
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4731
bors commentedon May 2, 2014
fast-forwarding master to auto = 9f836d5