Skip to content

Commit

Permalink
Update test suite to nightly-2021-07-09
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 9, 2021
1 parent 1296bac commit 436eb22
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion benches/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::fs;
use std::str::FromStr;
use test::Bencher;

const FILE: &str = "tests/rust/src/libcore/str/mod.rs";
const FILE: &str = "tests/rust/library/core/src/str/mod.rs";

#[bench]
fn parse_file(b: &mut Bencher) {
Expand Down
2 changes: 1 addition & 1 deletion benches/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ mod librustc_parse {
}
}

rustc_span::with_session_globals(Edition::Edition2018, || {
rustc_span::create_session_if_not_set_then(Edition::Edition2018, |_| {
let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let emitter = Box::new(SilentEmitter);
let handler = Handler::with_emitter(false, None, emitter);
Expand Down
3 changes: 3 additions & 0 deletions tests/repo/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ static EXCLUDE: &[&str] = &[
"src/test/ui/issues/issue-34074.rs",
"src/test/ui/proc-macro/trait-fn-args-2015.rs",

// Excessive nesting
"src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs",

// Not actually test cases
"src/test/rustdoc-ui/test-compile-fail2.rs",
"src/test/rustdoc-ui/test-compile-fail3.rs",
Expand Down
3 changes: 2 additions & 1 deletion tests/test_precedence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ fn test_expressions(edition: Edition, exprs: Vec<syn::Expr>) -> (usize, usize) {
let mut passed = 0;
let mut failed = 0;

rustc_span::with_session_globals(edition, || {
rustc_span::create_session_if_not_set_then(edition, |_| {
for expr in exprs {
let raw = quote!(#expr).to_string();

Expand Down Expand Up @@ -246,6 +246,7 @@ fn librustc_brackets(mut librustc_expr: P<ast::Expr>) -> Option<P<ast::Expr>> {
fields,
rest,
} = expr.deref_mut();
vis.visit_qself(qself);
vis.visit_path(path);
fields.flat_map_in_place(|field| flat_map_field(field, vis));
if let StructRest::Base(rest) = rest {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_round_trip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ fn test(path: &Path, failed: &AtomicUsize, abort_after: usize) {
let back = quote!(#krate).to_string();
let edition = repo::edition(path).parse().unwrap();

rustc_span::with_session_globals(edition, || {
rustc_span::create_session_if_not_set_then(edition, |_| {
let equal = match panic::catch_unwind(|| {
let sess = ParseSess::new(FilePathMapping::empty());
let before = match librustc_parse(content, &sess) {
Expand Down

0 comments on commit 436eb22

Please sign in to comment.