2 use crate::ast::{Item, ItemKind};
4 pub enum EntryPointType {
9 OtherMain, // Not an entry point, but some other function named main
12 // Beware, this is duplicated in librustc/middle/entry.rs, make sure to keep
14 pub fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
17 if attr::contains_name(&item.attrs, "start") {
19 } else if attr::contains_name(&item.attrs, "main") {
20 EntryPointType::MainAttr
21 } else if item.ident.name == "main" {
23 // This is a top-level function so can be 'main'
24 EntryPointType::MainNamed
26 EntryPointType::OtherMain
32 _ => EntryPointType::None,