From 7de5c6550d5f49e1addd2ca61e160290368d33da Mon Sep 17 00:00:00 2001 From: yukang Date: Sat, 27 Jan 2024 17:19:54 +0800 Subject: [PATCH] resolve conflicts --- compiler/rustc_attr/src/session_diagnostics.rs | 6 +++--- compiler/rustc_resolve/src/macros.rs | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_attr/src/session_diagnostics.rs b/compiler/rustc_attr/src/session_diagnostics.rs index e8151907f5494..d2f5429d8608c 100644 --- a/compiler/rustc_attr/src/session_diagnostics.rs +++ b/compiler/rustc_attr/src/session_diagnostics.rs @@ -408,8 +408,8 @@ impl IntoDiagnostic<'_, G> for InvalidAttrAtCrateLevel { #[track_caller] fn into_diagnostic(self, dcx: &'_ DiagCtxt, level: Level) -> DiagnosticBuilder<'_, G> { let mut diag = DiagnosticBuilder::new(dcx, level, fluent::attr_invalid_attr_at_crate_level); - diag.set_span(self.span); - diag.set_arg("name", self.name); + diag.span(self.span); + diag.arg("name", self.name); // Only emit an error with a suggestion if we can create a string out // of the attribute span if let Some(span) = self.sugg_span { @@ -421,7 +421,7 @@ impl IntoDiagnostic<'_, G> for InvalidAttrAtCrateLevel { ); } if let Some(item) = self.item { - diag.set_arg("kind", item.kind); + diag.arg("kind", item.kind); diag.span_label(item.span, fluent::attr_invalid_attr_at_crate_level_item); } diag diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index d13076e70169f..192ac124f5b9e 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -748,16 +748,16 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { if this.is_builtin_macro(res) || this.builtin_attrs_bindings.values().any(|b| b.res() == res) { - if !this.report_invalid_crate_level_attr(&krate.attrs, path[0].ident.name) { + if this.report_invalid_crate_level_attr(&krate.attrs, path[0].ident.name) { return; } - if this.tcx.dcx().has_errors().is_none() { - this.dcx().emit_err(CannotDetermineMacroResolution { - span, - kind: kind.descr(), - path: Segment::names_to_string(path), - }); - } + } + if this.tcx.dcx().has_errors().is_none() { + this.dcx().emit_err(CannotDetermineMacroResolution { + span, + kind: kind.descr(), + path: Segment::names_to_string(path), + }); } } }