]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/entry.rs
Rename `Item.node` to `Item.kind`
[rust.git] / src / libsyntax / entry.rs
index 09e26e29d86a81857a2092fa1b3407ae0b876711..34b5b1e5b5c84ce9c657425b2a3f7ec8d235f871 100644 (file)
@@ -1,5 +1,6 @@
 use crate::attr;
 use crate::ast::{Item, ItemKind};
+use crate::symbol::sym;
 
 pub enum EntryPointType {
     None,
@@ -12,13 +13,13 @@ pub enum EntryPointType {
 // Beware, this is duplicated in librustc/middle/entry.rs, make sure to keep
 // them in sync.
 pub fn entry_point_type(item: &Item, depth: usize) -> EntryPointType {
-    match item.node {
+    match item.kind {
         ItemKind::Fn(..) => {
-            if attr::contains_name(&item.attrs, "start") {
+            if attr::contains_name(&item.attrs, sym::start) {
                 EntryPointType::Start
-            } else if attr::contains_name(&item.attrs, "main") {
+            } else if attr::contains_name(&item.attrs, sym::main) {
                 EntryPointType::MainAttr
-            } else if item.ident.name == "main" {
+            } else if item.ident.name == sym::main {
                 if depth == 1 {
                     // This is a top-level function so can be 'main'
                     EntryPointType::MainNamed