Move edition outside the hygiene lock and avoid accessing it

This commit is contained in:
John Kåre Alsaker 2019-04-06 00:15:49 +02:00
parent 50a0defd5a
commit a1f2dceaeb
39 changed files with 155 additions and 139 deletions

View file

@ -105,7 +105,7 @@ fn reject_stmt_parse(es: &str) {
}
fn main() {
syntax::with_globals(|| run());
syntax::with_default_globals(|| run());
}
fn run() {

View file

@ -47,6 +47,6 @@ pub fn plugin_registrar(reg: &mut Registry) {
allow_internal_unsafe: false,
local_inner_macros: false,
unstable_feature: None,
edition: hygiene::default_edition(),
edition: reg.sess.edition(),
});
}

View file

@ -13,7 +13,7 @@ use syntax::parse::{self, ParseSess};
mod gravy;
pub fn main() {
syntax::with_globals(|| parse());
syntax::with_default_globals(|| parse());
assert_eq!(gravy::foo(), 10);
}

View file

@ -189,7 +189,7 @@ impl MutVisitor for AddParens {
}
fn main() {
syntax::with_globals(|| run());
syntax::with_default_globals(|| run());
}
fn run() {

View file

@ -15,7 +15,7 @@ error[E0425]: cannot find value `no` in this scope
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:319:13
thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:320:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
---- $DIR/failed-doctest-output.rs - SomeStruct (line 11) stdout ----
@ -24,7 +24,7 @@ thread '$DIR/failed-doctest-output.rs - SomeStruct (line 11)' panicked at 'test
thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
', src/librustdoc/test.rs:341:17
', src/librustdoc/test.rs:342:17
failures:

View file

@ -13,7 +13,7 @@ error: unterminated double quote string
error: aborting due to previous error
thread '$DIR/unparseable-doc-test.rs - foo (line 6)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:319:13
thread '$DIR/unparseable-doc-test.rs - foo (line 6)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:320:13
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.