Rollup merge of #152235 - JonathanBrouwer:convert_parse, r=JonathanBrouwer

Convert to inline diagnostics in `rustc_parse`

This was the most annoying one by far, had to make a few changes to the representation of two errors (no user-facing changes tho), these changes are in separate commits for clarity :)

For https://github.com/rust-lang/rust/issues/151366
r? @jdonszelmann
This commit is contained in:
Jonathan Brouwer 2026-02-07 13:06:34 +01:00 committed by GitHub
commit 828b9c2cdf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 1448 additions and 1796 deletions

View file

@ -10,6 +10,9 @@
//@ needs-symlink
//@ needs-subprocess
// FIXME(151366) Currently `-Ztranslate-additional-ftl` is currently broken
//@ ignore-test
#![deny(warnings)]
use std::path::{Path, PathBuf};

View file

@ -29,7 +29,7 @@ pub fn main() {
}
fn parse() {
let psess = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE]);
let psess = ParseSess::new(vec![]);
let path = Path::new(file!());
let path = path.canonicalize().unwrap();

View file

@ -219,7 +219,7 @@ fn main() {
}
fn run() {
let psess = ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE]);
let psess = ParseSess::new(vec![]);
iter_exprs(2, &mut |mut e| {
// If the pretty printer is correct, then `parse(print(e))` should be identical to `e`,

View file

@ -196,7 +196,7 @@ fn main() -> ExitCode {
};
rustc_span::create_default_session_globals_then(|| {
let psess = &ParseSess::new(vec![rustc_parse::DEFAULT_LOCALE_RESOURCE]);
let psess = &ParseSess::new(vec![]);
for &source_code in EXPRS {
let Some(expr) = parse_expr(psess, source_code) else {