]> git.lizzy.rs Git - rust.git/blobdiff - src/libsyntax/util/node_count.rs
Account for `ty::Error` when suggesting `impl Trait` or `Box<dyn Trait>`
[rust.git] / src / libsyntax / util / node_count.rs
index 3db9955d304a392249a311d069e3c12ff2cbeb2b..39f978ce98c6c169ec7ea08c0605cf02410f7001 100644 (file)
@@ -1,8 +1,8 @@
 // Simply gives a rought count of the number of nodes in an AST.
 
-use crate::visit::*;
 use crate::ast::*;
-use syntax_pos::Span;
+use crate::visit::*;
+use rustc_span::Span;
 
 pub struct NodeCounter {
     pub count: usize,
@@ -10,9 +10,7 @@ pub struct NodeCounter {
 
 impl NodeCounter {
     pub fn new() -> NodeCounter {
-        NodeCounter {
-            count: 0,
-        }
+        NodeCounter { count: 0 }
     }
 }
 
@@ -97,8 +95,13 @@ fn visit_struct_field(&mut self, s: &StructField) {
         self.count += 1;
         walk_struct_field(self, s)
     }
-    fn visit_enum_def(&mut self, enum_definition: &EnumDef,
-                      generics: &Generics, item_id: NodeId, _: Span) {
+    fn visit_enum_def(
+        &mut self,
+        enum_definition: &EnumDef,
+        generics: &Generics,
+        item_id: NodeId,
+        _: Span,
+    ) {
         self.count += 1;
         walk_enum_def(self, enum_definition, generics, item_id)
     }