From ff90b09f567914a435ff6b254af9dcf29d0c32c6 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 | 2 +- 2 files changed, 4 insertions(+), 4 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..67e2c1ce5932a 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -748,7 +748,7 @@ 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() {