File tree 2 files changed +12
-7
lines changed
compiler/rustc_passes/src
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
244
244
ops. push ( ( nested_expr, OpTy :: Deref ) ) ;
245
245
nested_expr = subexpr;
246
246
}
247
- hir:: ExprKind :: Field ( subexpr, _) => {
247
+ hir:: ExprKind :: Field ( subexpr, _) | hir :: ExprKind :: Index ( subexpr , _ ) => {
248
248
ops. push ( ( nested_expr, OpTy :: Project ) ) ;
249
249
nested_expr = subexpr;
250
250
}
251
- hir:: ExprKind :: Index ( subexpr, idxexpr) => {
252
- ops. push ( ( nested_expr, OpTy :: Project ) ) ;
253
- nested_expr = subexpr;
254
- intravisit:: walk_expr ( self , idxexpr) ;
255
- }
256
251
_ => {
257
252
drop ( ops) ;
258
253
intravisit:: walk_expr ( self , expr) ;
@@ -296,7 +291,9 @@ fn mark_local_terminating_scopes<'tcx>(expr: &'tcx hir::Expr<'tcx>) -> FxHashSet
296
291
| hir:: ExprKind :: Path ( ..) => self . probe ( expr) ,
297
292
298
293
// 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 ( ..)
300
297
| hir:: ExprKind :: Closure ( ..)
301
298
| hir:: ExprKind :: ConstBlock ( ..) => { }
302
299
_ => 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) {}
7
7
struct Client ;
8
8
9
9
impl Client {
10
+ fn zero ( & self ) -> usize {
11
+ 0
12
+ }
13
+
10
14
fn status ( & self ) -> i16 {
11
15
200
12
16
}
@@ -27,6 +31,10 @@ fn main() {
27
31
match ( & * & x) . status ( ) {
28
32
_ => yield ,
29
33
}
34
+ let a = [ 0 ] ;
35
+ match a[ Client . zero ( ) ] {
36
+ _ => yield ,
37
+ }
30
38
} ;
31
39
assert_send ( g) ;
32
40
}
You can’t perform that action at this time.
0 commit comments