File tree 2 files changed +17
-5
lines changed
compiler/rustc_builtin_macros/src
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -1237,15 +1237,17 @@ fn may_contain_yield_point(e: &ast::Expr) -> bool {
1237
1237
1238
1238
impl Visitor < ' _ > for MayContainYieldPoint {
1239
1239
fn visit_expr ( & mut self , e : & ast:: Expr ) {
1240
- if let ast:: ExprKind :: Await ( _) | ast:: ExprKind :: Yield ( _) | ast:: ExprKind :: MacCall ( _) =
1241
- e. kind
1242
- {
1240
+ if let ast:: ExprKind :: Await ( _) | ast:: ExprKind :: Yield ( _) = e. kind {
1243
1241
self . 0 = true ;
1244
1242
} else {
1245
1243
visit:: walk_expr ( self , e) ;
1246
1244
}
1247
1245
}
1248
1246
1247
+ fn visit_mac_call ( & mut self , _: & ast:: MacCall ) {
1248
+ self . 0 = true ;
1249
+ }
1250
+
1249
1251
fn visit_attribute ( & mut self , _: & ast:: Attribute ) {
1250
1252
// Conservatively assume this may be a proc macro attribute in
1251
1253
// expression position.
Original file line number Diff line number Diff line change @@ -11,13 +11,23 @@ async fn with_await() {
11
11
println ! ( "{} {:?}" , "" , async { } . await ) ;
12
12
}
13
13
14
- async fn with_macro_call ( ) {
14
+ async fn with_macro_call_expr ( ) {
15
15
println ! ( "{} {:?}" , "" , m!( ) ) ;
16
16
}
17
17
18
+ async fn with_macro_call_stmt_semi ( ) {
19
+ println ! ( "{} {:?}" , "" , { m!( ) ; } ) ;
20
+ }
21
+
22
+ async fn with_macro_call_stmt_braced ( ) {
23
+ println ! ( "{} {:?}" , "" , { m!{ } } ) ;
24
+ }
25
+
18
26
fn assert_send ( _: impl Send ) { }
19
27
20
28
fn main ( ) {
21
29
assert_send ( with_await ( ) ) ;
22
- assert_send ( with_macro_call ( ) ) ;
30
+ assert_send ( with_macro_call_expr ( ) ) ;
31
+ assert_send ( with_macro_call_stmt_semi ( ) ) ;
32
+ assert_send ( with_macro_call_stmt_braced ( ) ) ;
23
33
}
You can’t perform that action at this time.
0 commit comments