From 556b10bf201264172e4b840f8cf1be38b8d75738 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 6 Mar 2024 09:26:00 -0800 Subject: [PATCH] Update test suite to nightly-2024-03-06 --- tests/common/parse.rs | 4 +--- tests/test_round_trip.rs | 10 ++++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/tests/common/parse.rs b/tests/common/parse.rs index dce0066251..2d00a62f46 100644 --- a/tests/common/parse.rs +++ b/tests/common/parse.rs @@ -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> { 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()), diff --git a/tests/test_round_trip.rs b/tests/test_round_trip.rs index 3c49185124..7619f3bcb2 100644 --- a/tests/test_round_trip.rs +++ b/tests/test_round_trip.rs @@ -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; @@ -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) => { @@ -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| {