@@ -821,57 +821,30 @@ fn trans_lvalue_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
821
821
822
822
trace_span ! ( bcx, expr. span, @shorten( bcx. expr_to_str( expr) ) ) ;
823
823
824
- let unrooted_datum = unpack_datum ! ( bcx, unrooted( bcx, expr) ) ;
825
-
826
- // If the lvalue must remain rooted, create a scratch datum, copy
827
- // the lvalue in there, and then arrange for it to be cleaned up
828
- // at the end of the scope with id `scope_id`:
829
- let root_key = root_map_key { id : expr. id , derefs : 0 u } ;
830
- for bcx . ccx( ) . maps. root_map. find( & root_key) . each |& root_info| {
831
- bcx = unrooted_datum. root( bcx, expr. span, * root_info) ;
832
- }
833
-
834
- return DatumBlock { bcx : bcx, datum : unrooted_datum} ;
835
-
836
- fn unrooted( bcx: block, expr: @ast:: expr) -> DatumBlock {
837
- /*!
838
- *
839
- * Translates `expr`. Note that this version generally
840
- * yields an unrooted, unmoved version. Rooting and possible
841
- * moves are dealt with above in trans_lvalue_unadjusted().
842
- *
843
- * One exception is if `expr` refers to a local variable,
844
- * in which case the source may already be FromMovedLvalue
845
- * if appropriate.
846
- */
847
-
848
- let mut bcx = bcx;
849
-
850
- match expr. node {
851
- ast : : expr_paren( e) => {
852
- return unrooted( bcx, e) ;
853
- }
854
- ast:: expr_path( _) => {
855
- return trans_def_lvalue( bcx, expr, bcx. def( expr. id) ) ;
856
- }
857
- ast:: expr_field( base, ident, _) => {
858
- return trans_rec_field( bcx, base, ident) ;
859
- }
860
- ast:: expr_index( base, idx) => {
861
- return trans_index( bcx, expr, base, idx) ;
862
- }
863
- ast:: expr_unary( ast:: deref, base) => {
864
- let basedatum = unpack_datum ! ( bcx, trans_to_datum( bcx, base) ) ;
865
- return basedatum. deref( bcx, base, 0 ) ;
866
- }
867
- _ => {
868
- bcx. tcx( ) . sess. span_bug(
869
- expr. span,
870
- fmt ! ( "trans_lvalue reached fall-through case: %?" ,
871
- expr. node) ) ;
872
- }
824
+ return match expr. node {
825
+ ast:: expr_paren( e) => {
826
+ unrooted ( bcx, e)
873
827
}
874
- }
828
+ ast:: expr_path( _) => {
829
+ trans_def_lvalue ( bcx, expr, bcx. def ( expr. id ) )
830
+ }
831
+ ast:: expr_field( base, ident, _) => {
832
+ trans_rec_field ( bcx, base, ident)
833
+ }
834
+ ast:: expr_index( base, idx) => {
835
+ trans_index ( bcx, expr, base, idx)
836
+ }
837
+ ast:: expr_unary( ast:: deref, base) => {
838
+ let basedatum = unpack_datum ! ( bcx, trans_to_datum( bcx, base) ) ;
839
+ basedatum. deref ( bcx, base, 0 )
840
+ }
841
+ _ => {
842
+ bcx. tcx ( ) . sess . span_bug (
843
+ expr. span ,
844
+ fmt ! ( "trans_lvalue reached fall-through case: %?" ,
845
+ expr. node) ) ;
846
+ }
847
+ } ;
875
848
876
849
fn trans_rec_field ( bcx : block ,
877
850
base : @ast:: expr ,
0 commit comments