about summary refs log tree commit diff
path: root/src/utils.rs
diff options
context:
space:
mode:
authorkngwyu <yuji.kngw.80s.revive@gmail.com>2018-12-08 14:39:52 +0900
committerkngwyu <yuji.kngw.80s.revive@gmail.com>2018-12-08 14:39:52 +0900
commitfd27eabbb7350a3b413f33728ae315be2e184825 (patch)
treeb978f4724d0b84c82919e315d53051ff319049bf /src/utils.rs
parent3ccc1f8a06b3d01eebe63026f90c9e7e66b3247c (diff)
Update rustc-ap-syntax to 306.0
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/utils.rs b/src/utils.rs
index c5f9a5eda5e..7f1bc284180 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -14,11 +14,12 @@ use bytecount;
 
 use rustc_target::spec::abi;
 use syntax::ast::{
-    self, Attribute, CrateSugar, MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind, Path,
-    Visibility, VisibilityKind,
+    self, Attribute, CrateSugar, MetaItem, MetaItemKind, NestedMetaItem, NestedMetaItemKind,
+    NodeId, Path, Visibility, VisibilityKind,
 };
 use syntax::ptr;
 use syntax::source_map::{BytePos, Span, NO_EXPANSION};
+use syntax_pos::Mark;
 
 use comment::{filter_normal_code, CharClasses, FullCodeCharKind, LineClasses};
 use config::Config;
@@ -582,6 +583,16 @@ fn get_prefix_space_width(config: &Config, s: &str) -> usize {
     width
 }
 
+pub(crate) trait NodeIdExt {
+    fn root() -> Self;
+}
+
+impl NodeIdExt for NodeId {
+    fn root() -> NodeId {
+        NodeId::placeholder_from_mark(Mark::root())
+    }
+}
+
 #[cfg(test)]
 mod test {
     use super::*;