Recognize custom main function as binary entrypoint for runnables

This commit is contained in:
Lukas Wirth 2023-10-04 12:04:37 +02:00
parent 7b8330f283
commit fe398163b6
3 changed files with 72 additions and 23 deletions

View file

@ -215,6 +215,10 @@ impl Attrs {
self.doc_exprs().flat_map(|doc_expr| doc_expr.aliases().to_vec())
}
pub fn export_name(&self) -> Option<&SmolStr> {
self.by_key("export_name").string_value()
}
pub fn is_proc_macro(&self) -> bool {
self.by_key("proc_macro").exists()
}