Skip to content

Commit 8d5a9fe

Browse files
Convert to inline diagnostics in rustc_parse
1 parent efc9e1b commit 8d5a9fe

16 files changed

Lines changed: 1401 additions & 1776 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4383,7 +4383,6 @@ dependencies = [
43834383
"rustc_data_structures",
43844384
"rustc_errors",
43854385
"rustc_feature",
4386-
"rustc_fluent_macro",
43874386
"rustc_index",
43884387
"rustc_lexer",
43894388
"rustc_macros",

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ pub static DEFAULT_LOCALE_RESOURCES: &[&str] = &[
116116
rustc_const_eval::DEFAULT_LOCALE_RESOURCE,
117117
rustc_lint::DEFAULT_LOCALE_RESOURCE,
118118
rustc_mir_build::DEFAULT_LOCALE_RESOURCE,
119-
rustc_parse::DEFAULT_LOCALE_RESOURCE,
120119
// tidy-alphabetical-end
121120
];
122121

compiler/rustc_interface/src/interface.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ pub struct Compiler {
5353
pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec<String>) -> Cfg {
5454
cfgs.into_iter()
5555
.map(|s| {
56-
let psess = ParseSess::emitter_with_note(
57-
vec![rustc_parse::DEFAULT_LOCALE_RESOURCE],
58-
format!("this occurred on the command line: `--cfg={s}`"),
59-
);
56+
let psess = ParseSess::emitter_with_note(format!(
57+
"this occurred on the command line: `--cfg={s}`"
58+
));
6059
let filename = FileName::cfg_spec_source_code(&s);
6160

6261
macro_rules! error {
@@ -125,10 +124,9 @@ pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> Ch
125124
let mut check_cfg = CheckCfg { exhaustive_names, exhaustive_values, ..CheckCfg::default() };
126125

127126
for s in specs {
128-
let psess = ParseSess::emitter_with_note(
129-
vec![rustc_parse::DEFAULT_LOCALE_RESOURCE],
130-
format!("this occurred on the command line: `--check-cfg={s}`"),
131-
);
127+
let psess = ParseSess::emitter_with_note(format!(
128+
"this occurred on the command line: `--check-cfg={s}`"
129+
));
132130
let filename = FileName::cfg_spec_source_code(&s);
133131

134132
const VISIT: &str =

compiler/rustc_macros/src/diagnostics/message.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use fluent_syntax::ast::{Expression, InlineExpression, Pattern, PatternElement};
33
use proc_macro2::{Span, TokenStream};
44
use quote::quote;
55
use syn::Path;
6+
use syn::ext::IdentExt;
67
use synstructure::{Structure, VariantInfo};
78

89
use crate::diagnostics::error::span_err;
@@ -100,7 +101,7 @@ fn verify_fluent_message(msg_span: Span, message: &str, variant: &VariantInfo<'_
100101
.bindings()
101102
.iter()
102103
.flat_map(|b| b.ast().ident.as_ref())
103-
.map(|id| id.to_string())
104+
.map(|id| id.unraw().to_string())
104105
.collect();
105106
for variable in variable_references(&message) {
106107
if !fields.iter().any(|f| f == variable) {

compiler/rustc_parse/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }
1414
rustc_feature = { path = "../rustc_feature" }
15-
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
1615
rustc_index = { path = "../rustc_index" }
1716
rustc_lexer = { path = "../rustc_lexer" }
1817
rustc_macros = { path = "../rustc_macros" }

0 commit comments

Comments
 (0)