Skip to content

Commit

Permalink
Allow emitting diagnostics from the #[diagnostic] namespace without a
Browse files Browse the repository at this point in the history
nightly feature

(Using this attribute still requires a nightly feature, this just
enables that this feature does not need to be enabled on the child crate
as well)
  • Loading branch information
weiznich committed Dec 21, 2023
1 parent 920e005 commit 5d63f5d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ impl<'tcx> OnUnimplementedDirective {
pub fn of_item(tcx: TyCtxt<'tcx>, item_def_id: DefId) -> Result<Option<Self>, ErrorGuaranteed> {
if let Some(attr) = tcx.get_attr(item_def_id, sym::rustc_on_unimplemented) {
return Self::parse_attribute(attr, false, tcx, item_def_id);
} else if tcx.features().diagnostic_namespace {
} else {
tcx.get_attrs_by_path(item_def_id, &[sym::diagnostic, sym::on_unimplemented])
.filter_map(|attr| Self::parse_attribute(attr, true, tcx, item_def_id).transpose())
.try_fold(None, |aggr: Option<Self>, directive| {
Expand Down Expand Up @@ -621,8 +621,6 @@ impl<'tcx> OnUnimplementedDirective {
Ok(Some(directive))
}
})
} else {
Ok(None)
}
}

Expand Down

0 comments on commit 5d63f5d

Please sign in to comment.