Skip to content

Commit 6dd7e1e

Browse files
committed
feat: nested functions with offload_kernel
1 parent e16d9ee commit 6dd7e1e

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎compiler/rustc_builtin_macros/src/offload.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ fn extract_fn(
2828
}
2929
_ => None,
3030
},
31+
Annotatable::Stmt(stmt) => match &stmt.kind {
32+
ast::StmtKind::Item(iitem) => match &iitem.kind {
33+
ast::ItemKind::Fn(ast::Fn { sig, ident, generics, body, .. }) => {
34+
Some((iitem.vis.clone(), sig.clone(), *ident, generics.clone(), body.clone()))
35+
}
36+
_ => None,
37+
},
38+
_ => None,
39+
},
3140
_ => None,
3241
}
3342
}

0 commit comments

Comments
 (0)