1
Fork 0

Rename many DiagCtxt and EarlyDiagCtxt locals.

This commit is contained in:
Nicholas Nethercote 2023-12-18 11:15:13 +11:00
parent d58e372853
commit f6aa418c9f
33 changed files with 250 additions and 258 deletions

View file

@ -402,7 +402,7 @@ pub fn compile_declarative_macro(
};
let dummy_syn_ext = || (mk_syn_ext(Box::new(macro_rules_dummy_expander)), Vec::new());
let diag = &sess.parse_sess.dcx;
let dcx = &sess.parse_sess.dcx;
let lhs_nm = Ident::new(sym::lhs, def.span);
let rhs_nm = Ident::new(sym::rhs, def.span);
let tt_spec = Some(NonterminalKind::TT);
@ -560,10 +560,10 @@ pub fn compile_declarative_macro(
let (transparency, transparency_error) = attr::find_transparency(&def.attrs, macro_rules);
match transparency_error {
Some(TransparencyError::UnknownTransparency(value, span)) => {
diag.span_err(span, format!("unknown macro transparency: `{value}`"));
dcx.span_err(span, format!("unknown macro transparency: `{value}`"));
}
Some(TransparencyError::MultipleTransparencyAttrs(old_span, new_span)) => {
diag.span_err(vec![old_span, new_span], "multiple macro transparency attributes");
dcx.span_err(vec![old_span, new_span], "multiple macro transparency attributes");
}
None => {}
}

View file

@ -33,8 +33,8 @@ fn create_test_handler() -> (DiagCtxt, Lrc<SourceMap>, Arc<Mutex<Vec<u8>>>) {
let emitter = EmitterWriter::new(Box::new(Shared { data: output.clone() }), fallback_bundle)
.sm(Some(source_map.clone()))
.diagnostic_width(Some(140));
let handler = DiagCtxt::with_emitter(Box::new(emitter));
(handler, source_map, output)
let dcx = DiagCtxt::with_emitter(Box::new(emitter));
(dcx, source_map, output)
}
/// Returns the result of parsing the given string via the given callback.