File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
src/librustc/middle/borrowck Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -764,18 +764,17 @@ impl<'a> CheckLoanCtxt<'a> {
764
764
return ;
765
765
766
766
fn mark_variable_as_used_mut ( this : & CheckLoanCtxt ,
767
- cmt : mc:: cmt ) {
767
+ mut cmt : mc:: cmt ) {
768
768
//! If the mutability of the `cmt` being written is inherited
769
769
//! from a local variable, liveness will
770
770
//! not have been able to detect that this variable's mutability
771
771
//! is important, so we must add the variable to the
772
772
//! `used_mut_nodes` table here.
773
773
774
- let mut cmt = cmt;
775
774
loop {
776
- debug ! ( "mark_writes_through_upvars_as_used_mut(cmt={})" ,
777
- cmt. repr( this. tcx( ) ) ) ;
775
+ debug ! ( "mark_variable_as_used_mut(cmt={})" , cmt. repr( this. tcx( ) ) ) ;
778
776
match cmt. cat . clone ( ) {
777
+ mc:: cat_copied_upvar( mc:: CopiedUpvar { upvar_id : id, .. } ) |
779
778
mc:: cat_local( id) | mc:: cat_arg( id) => {
780
779
this. tcx ( ) . used_mut_nodes . borrow_mut ( ) . insert ( id) ;
781
780
return ;
@@ -792,7 +791,6 @@ impl<'a> CheckLoanCtxt<'a> {
792
791
793
792
mc:: cat_rvalue( ..) |
794
793
mc:: cat_static_item |
795
- mc:: cat_copied_upvar( ..) |
796
794
mc:: cat_deref( _, _, mc:: UnsafePtr ( ..) ) |
797
795
mc:: cat_deref( _, _, mc:: BorrowedPtr ( ..) ) |
798
796
mc:: cat_deref( _, _, mc:: Implicit ( ..) ) => {
You can’t perform that action at this time.
0 commit comments