]> git.lizzy.rs Git - rust.git/commitdiff
syntax: reexport attr globals
authorMazdak Farrokhzad <twingoow@gmail.com>
Sat, 18 Jan 2020 17:57:06 +0000 (18:57 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Sat, 1 Feb 2020 17:59:49 +0000 (18:59 +0100)
src/librustc_ast_pretty/pprust/tests.rs
src/librustc_interface/interface.rs
src/librustc_interface/util.rs
src/librustdoc/test.rs
src/libsyntax/lib.rs

index ec6f5096d91af21160311c413e1914d896613fe0..279e6f518a71da1f2eeb74b24829507727894157 100644 (file)
@@ -3,7 +3,7 @@
 use rustc_span;
 use rustc_span::source_map::{dummy_spanned, respan};
 use syntax::ast;
-use syntax::attr::with_default_globals;
+use syntax::with_default_globals;
 
 fn fun_to_string(
     decl: &ast::FnDecl,
index ae758b5e3273af7c821bbe6d408a23b766c26fa0..2a667541ad3e7f2cc1350b77e5a928e19aceae4b 100644 (file)
@@ -65,7 +65,7 @@ pub fn output_file(&self) -> &Option<PathBuf> {
 
 /// Converts strings provided as `--cfg [cfgspec]` into a `crate_cfg`.
 pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String>)> {
-    syntax::attr::with_default_globals(move || {
+    syntax::with_default_globals(move || {
         let cfg = cfgspecs
             .into_iter()
             .map(|s| {
index 3f59a0ca34a24f6bfd518a78a3d620107d8140c9..3052c9fc26f081a8e06f0fa5648cca46527eaa7f 100644 (file)
@@ -147,7 +147,7 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
     crate::callbacks::setup_callbacks();
 
     scoped_thread(cfg, || {
-        syntax::attr::with_globals(edition, || {
+        syntax::with_globals(edition, || {
             ty::tls::GCX_PTR.set(&Lock::new(0), || {
                 if let Some(stderr) = stderr {
                     io::set_panic(Some(box Sink(stderr.clone())));
@@ -183,15 +183,15 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
 
     let with_pool = move |pool: &ThreadPool| pool.install(move || f());
 
-    syntax::attr::with_globals(edition, || {
-        syntax::attr::GLOBALS.with(|syntax_globals| {
+    syntax::with_globals(edition, || {
+        syntax::GLOBALS.with(|syntax_globals| {
             rustc_span::GLOBALS.with(|rustc_span_globals| {
                 // The main handler runs for each Rayon worker thread and sets up
                 // the thread local rustc uses. syntax_globals and rustc_span_globals are
                 // captured and set on the new threads. ty::tls::with_thread_locals sets up
                 // thread local callbacks from libsyntax
                 let main_handler = move |thread: ThreadBuilder| {
-                    syntax::attr::GLOBALS.set(syntax_globals, || {
+                    syntax::GLOBALS.set(syntax_globals, || {
                         rustc_span::GLOBALS.set(rustc_span_globals, || {
                             if let Some(stderr) = stderr {
                                 io::set_panic(Some(box Sink(stderr.clone())));
index 52776eabdf562904c238f5102da6b39f9c231c10..936f63975a58e5307deb4ce9ff421a0cdad29065 100644 (file)
@@ -18,7 +18,7 @@
 use std::process::{self, Command, Stdio};
 use std::str;
 use syntax::ast;
-use syntax::attr::with_globals;
+use syntax::with_globals;
 use tempfile::Builder as TempFileBuilder;
 use testing;
 
index c9800da700fc5a24fa7127d6c609fc14d2061727..66c747f2c517a877ad3f20d5d5215f0695d8989e 100644 (file)
@@ -38,6 +38,7 @@ pub mod util {
 
 pub mod ast;
 pub mod attr;
+pub use attr::{with_default_globals, with_globals, GLOBALS};
 pub mod entry;
 pub mod expand;
 pub mod mut_visit;