File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -1408,7 +1408,7 @@ pub fn get_enclosing_loop_or_multi_call_closure<'tcx>(
14081408 ExprKind :: Closure { .. } | ExprKind :: Loop ( ..) => return Some ( e) ,
14091409 _ => ( ) ,
14101410 } ,
1411- Node :: Stmt ( _) | Node :: Block ( _) | Node :: LetStmt ( _) | Node :: Arm ( _) => ( ) ,
1411+ Node :: Stmt ( _) | Node :: Block ( _) | Node :: LetStmt ( _) | Node :: Arm ( _) | Node :: ExprField ( _ ) => ( ) ,
14121412 _ => break ,
14131413 }
14141414 }
Original file line number Diff line number Diff line change @@ -52,3 +52,21 @@ struct S<'a> {
5252fn from_field<'a>(s: &'a mut S<'a>) -> Option<&'a mut usize> {
5353 s.opt.as_deref_mut()
5454}
55+
56+ mod issue_non_copy_13077 {
57+ pub fn something(mut maybe_side_effect: Option<&mut String>) {
58+ for _ in 0..10 {
59+ let _ = S {
60+ field: other(maybe_side_effect.as_deref_mut()),
61+ };
62+ }
63+ }
64+
65+ fn other(_maybe_side_effect: Option<&mut String>) {
66+ unimplemented!()
67+ }
68+
69+ pub struct S {
70+ pub field: (),
71+ }
72+ }
Original file line number Diff line number Diff line change @@ -52,3 +52,21 @@ struct S<'a> {
5252fn from_field < ' a > ( s : & ' a mut S < ' a > ) -> Option < & ' a mut usize > {
5353 s. opt . as_deref_mut ( )
5454}
55+
56+ mod issue_non_copy_13077 {
57+ pub fn something ( mut maybe_side_effect : Option < & mut String > ) {
58+ for _ in 0 ..10 {
59+ let _ = S {
60+ field : other ( maybe_side_effect. as_deref_mut ( ) ) ,
61+ } ;
62+ }
63+ }
64+
65+ fn other ( _maybe_side_effect : Option < & mut String > ) {
66+ unimplemented ! ( )
67+ }
68+
69+ pub struct S {
70+ pub field : ( ) ,
71+ }
72+ }
You can’t perform that action at this time.
0 commit comments