Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Jan 27, 2024
1 parent 5c89b70 commit 7de5c65
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_attr/src/session_diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,8 +408,8 @@ impl<G: EmissionGuarantee> 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 {
Expand All @@ -421,7 +421,7 @@ impl<G: EmissionGuarantee> 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
Expand Down
16 changes: 8 additions & 8 deletions compiler/rustc_resolve/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
});
}
}
}
Expand Down

0 comments on commit 7de5c65

Please sign in to comment.