Skip to content

Commit e7a7964

Browse files
committed
syntax: reexport attr globals
1 parent 279e214 commit e7a7964

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/librustc_ast_pretty/pprust/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::*;
33
use rustc_span;
44
use rustc_span::source_map::{dummy_spanned, respan};
55
use syntax::ast;
6-
use syntax::attr::with_default_globals;
6+
use syntax::with_default_globals;
77

88
fn fun_to_string(
99
decl: &ast::FnDecl,

src/librustc_interface/interface.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Compiler {
6565

6666
/// Converts strings provided as `--cfg [cfgspec]` into a `crate_cfg`.
6767
pub fn parse_cfgspecs(cfgspecs: Vec<String>) -> FxHashSet<(String, Option<String>)> {
68-
syntax::attr::with_default_globals(move || {
68+
syntax::with_default_globals(move || {
6969
let cfg = cfgspecs
7070
.into_iter()
7171
.map(|s| {

src/librustc_interface/util.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
147147
crate::callbacks::setup_callbacks();
148148

149149
scoped_thread(cfg, || {
150-
syntax::attr::with_globals(edition, || {
150+
syntax::with_globals(edition, || {
151151
ty::tls::GCX_PTR.set(&Lock::new(0), || {
152152
if let Some(stderr) = stderr {
153153
io::set_panic(Some(box Sink(stderr.clone())));
@@ -183,15 +183,15 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
183183

184184
let with_pool = move |pool: &ThreadPool| pool.install(move || f());
185185

186-
syntax::attr::with_globals(edition, || {
187-
syntax::attr::GLOBALS.with(|syntax_globals| {
186+
syntax::with_globals(edition, || {
187+
syntax::GLOBALS.with(|syntax_globals| {
188188
rustc_span::GLOBALS.with(|rustc_span_globals| {
189189
// The main handler runs for each Rayon worker thread and sets up
190190
// the thread local rustc uses. syntax_globals and rustc_span_globals are
191191
// captured and set on the new threads. ty::tls::with_thread_locals sets up
192192
// thread local callbacks from libsyntax
193193
let main_handler = move |thread: ThreadBuilder| {
194-
syntax::attr::GLOBALS.set(syntax_globals, || {
194+
syntax::GLOBALS.set(syntax_globals, || {
195195
rustc_span::GLOBALS.set(rustc_span_globals, || {
196196
if let Some(stderr) = stderr {
197197
io::set_panic(Some(box Sink(stderr.clone())));

src/librustdoc/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use std::path::PathBuf;
1818
use std::process::{self, Command, Stdio};
1919
use std::str;
2020
use syntax::ast;
21-
use syntax::attr::with_globals;
21+
use syntax::with_globals;
2222
use tempfile::Builder as TempFileBuilder;
2323
use testing;
2424

src/libsyntax/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ pub mod util {
3838

3939
pub mod ast;
4040
pub mod attr;
41+
pub use attr::{with_default_globals, with_globals, GLOBALS};
4142
pub mod entry;
4243
pub mod expand;
4344
pub mod mut_visit;

0 commit comments

Comments
 (0)