about summary refs log tree commit diff
path: root/src/libsyntax/lib.rs
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-12-22 17:42:04 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2019-12-22 17:42:47 -0500
commita06baa56b95674fc626b3c3fd680d6a65357fe60 (patch)
treecd9d867c2ca3cff5c1d6b3bd73377c44649fb075 /src/libsyntax/lib.rs
parent8eb7c58dbb7b32701af113bc58722d0d1fefb1eb (diff)
downloadrust-a06baa56b95674fc626b3c3fd680d6a65357fe60.tar.gz
rust-a06baa56b95674fc626b3c3fd680d6a65357fe60.zip
Format the world
Diffstat (limited to 'src/libsyntax/lib.rs')
-rw-r--r--src/libsyntax/lib.rs29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 30fd23ea909..31370e2c92e 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -4,9 +4,7 @@
 //!
 //! This API is completely unstable and subject to change.
 
-#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
-       test(attr(deny(warnings))))]
-
+#![doc(html_root_url = "https://doc.rust-lang.org/nightly/", test(attr(deny(warnings))))]
 #![feature(bool_to_option)]
 #![feature(box_syntax)]
 #![feature(const_fn)]
@@ -18,13 +16,12 @@
 #![feature(try_trait)]
 #![feature(slice_patterns)]
 #![feature(unicode_internals)]
+#![recursion_limit = "256"]
 
-#![recursion_limit="256"]
-
+use ast::AttrId;
 pub use errors;
 use rustc_data_structures::sync::Lock;
 use rustc_index::bit_set::GrowableBitSet;
-use ast::AttrId;
 use syntax_pos::edition::Edition;
 
 #[macro_export]
@@ -34,7 +31,7 @@ macro_rules! unwrap_or {
             Some(x) => x,
             None => $default,
         }
-    }
+    };
 }
 
 pub struct Globals {
@@ -56,16 +53,16 @@ impl Globals {
 }
 
 pub fn with_globals<F, R>(edition: Edition, f: F) -> R
-    where F: FnOnce() -> R
+where
+    F: FnOnce() -> R,
 {
     let globals = Globals::new(edition);
-    GLOBALS.set(&globals, || {
-        syntax_pos::GLOBALS.set(&globals.syntax_pos_globals, f)
-    })
+    GLOBALS.set(&globals, || syntax_pos::GLOBALS.set(&globals.syntax_pos_globals, f))
 }
 
 pub fn with_default_globals<F, R>(f: F) -> R
-    where F: FnOnce() -> R
+where
+    F: FnOnce() -> R,
 {
     with_globals(edition::DEFAULT_EDITION, f)
 }
@@ -83,9 +80,9 @@ pub mod util {
     pub mod comments;
     pub mod lev_distance;
     pub mod literal;
+    pub mod map_in_place;
     pub mod node_count;
     pub mod parser;
-    pub mod map_in_place;
 }
 
 pub mod ast;
@@ -95,22 +92,22 @@ pub use syntax_pos::source_map;
 pub mod entry;
 pub mod feature_gate {
     mod check;
-    pub use check::{check_crate, check_attribute, get_features, feature_err, feature_err_issue};
+    pub use check::{check_attribute, check_crate, feature_err, feature_err_issue, get_features};
 }
 pub mod mut_visit;
 pub mod ptr;
 pub mod show_span;
+pub use rustc_session::parse as sess;
 pub use syntax_pos::edition;
 pub use syntax_pos::symbol;
-pub use rustc_session::parse as sess;
 pub mod token;
 pub mod tokenstream;
 pub mod visit;
 
 pub mod print {
+    mod helpers;
     pub mod pp;
     pub mod pprust;
-    mod helpers;
 }
 
 pub mod early_buffered_lints;