File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
compiler/rustc_passes/src Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -244,15 +244,10 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet
244244 ops. push ( ( nested_expr, OpTy :: Deref ) ) ;
245245 nested_expr = subexpr;
246246 }
247- hir:: ExprKind :: Field ( subexpr, _) => {
247+ hir:: ExprKind :: Field ( subexpr, _) | hir :: ExprKind :: Index ( subexpr , _ ) => {
248248 ops. push ( ( nested_expr, OpTy :: Project ) ) ;
249249 nested_expr = subexpr;
250250 }
251- hir:: ExprKind :: Index ( subexpr, idxexpr) => {
252- ops. push ( ( nested_expr, OpTy :: Project ) ) ;
253- nested_expr = subexpr;
254- intravisit:: walk_expr ( self , idxexpr) ;
255- }
256251 _ => {
257252 drop ( ops) ;
258253 intravisit:: walk_expr ( self , expr) ;
@@ -296,7 +291,9 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet
296291 | hir:: ExprKind :: Path ( ..) => self . probe ( expr) ,
297292
298293 // We do not probe into other function bodies or blocks.
299- hir:: ExprKind :: Block ( ..)
294+ hir:: ExprKind :: If ( ..)
295+ | hir:: ExprKind :: Match ( ..)
296+ | hir:: ExprKind :: Block ( ..)
300297 | hir:: ExprKind :: Closure ( ..)
301298 | hir:: ExprKind :: ConstBlock ( ..) => { }
302299 _ => intravisit:: walk_expr ( self , expr) ,
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ fn assert_send<T: Send>(_: T) {}
77struct Client ;
88
99impl Client {
10+ fn zero ( & self ) -> usize {
11+ 0
12+ }
13+
1014 fn status ( & self ) -> i16 {
1115 200
1216 }
@@ -27,6 +31,10 @@ fn main() {
2731 match ( & * & x) . status ( ) {
2832 _ => yield ,
2933 }
34+ let a = [ 0 ] ;
35+ match a[ Client . zero ( ) ] {
36+ _ => yield ,
37+ }
3038 } ;
3139 assert_send ( g) ;
3240}
You can’t perform that action at this time.
0 commit comments