Skip to content

Commit

Permalink
Update test suite to nightly-2024-03-06
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 6, 2024
1 parent ff6ebfb commit 556b10b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 1 addition & 3 deletions tests/common/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@ extern crate rustc_span;
use rustc_ast::ast;
use rustc_ast::ptr::P;
use rustc_session::parse::ParseSess;
use rustc_span::source_map::FilePathMapping;
use rustc_span::FileName;
use std::panic;

pub fn librustc_expr(input: &str) -> Option<P<ast::Expr>> {
match panic::catch_unwind(|| {
let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
let file_path_mapping = FilePathMapping::empty();
let sess = ParseSess::new(locale_resources, file_path_mapping);
let sess = ParseSess::new(locale_resources);
let e = parse::new_parser_from_source_str(
&sess,
FileName::Custom("test_precedence".to_string()),
Expand Down
10 changes: 4 additions & 6 deletions tests/test_round_trip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ use rustc_ast::ast::{
};
use rustc_ast::mut_visit::{self, MutVisitor};
use rustc_ast_pretty::pprust;
use rustc_error_messages::{DiagnosticMessage, LazyFallbackBundle};
use rustc_error_messages::{DiagMessage, LazyFallbackBundle};
use rustc_errors::{translation, Diag, PResult};
use rustc_session::parse::ParseSess;
use rustc_span::source_map::FilePathMapping;
use rustc_span::FileName;
use std::borrow::Cow;
use std::fs;
Expand Down Expand Up @@ -90,8 +89,7 @@ fn test(path: &Path, failed: &AtomicUsize, abort_after: usize) {
rustc_span::create_session_if_not_set_then(edition, |_| {
let equal = match panic::catch_unwind(|| {
let locale_resources = rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec();
let file_path_mapping = FilePathMapping::empty();
let sess = ParseSess::new(locale_resources, file_path_mapping);
let sess = ParseSess::new(locale_resources);
let before = match librustc_parse(content, &sess) {
Ok(before) => before,
Err(diagnostic) => {
Expand Down Expand Up @@ -169,8 +167,8 @@ fn translate_message(diagnostic: &Diag) -> Cow<'static, str> {
let args = translation::to_fluent_args(diagnostic.args.iter());

let (identifier, attr) = match message {
DiagnosticMessage::Str(msg) | DiagnosticMessage::Translated(msg) => return msg.clone(),
DiagnosticMessage::FluentIdentifier(identifier, attr) => (identifier, attr),
DiagMessage::Str(msg) | DiagMessage::Translated(msg) => return msg.clone(),
DiagMessage::FluentIdentifier(identifier, attr) => (identifier, attr),
};

FLUENT_BUNDLE.with(|fluent_bundle| {
Expand Down

0 comments on commit 556b10b

Please sign in to comment.