Move #[do_not_recommend] to the #[diagnostic] namespace

This commit moves the `#[do_not_recommend]` attribute to the
`#[diagnostic]` namespace. It still requires
`#![feature(do_not_recommend)]` to work.
This commit is contained in:
Georg Semmler 2024-05-10 14:12:30 +02:00
parent e8ada6ab25
commit 2cff3e90bc
No known key found for this signature in database
GPG key ID: A87BCEE5205CE489
22 changed files with 228 additions and 209 deletions

View file

@ -567,7 +567,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
if res == Res::NonMacroAttr(NonMacroAttrKind::Tool)
&& let [namespace, attribute, ..] = &*path.segments
&& namespace.ident.name == sym::diagnostic
&& attribute.ident.name != sym::on_unimplemented
&& !(attribute.ident.name == sym::on_unimplemented
|| (attribute.ident.name == sym::do_not_recommend
&& self.tcx.features().do_not_recommend))
{
let distance =
edit_distance(attribute.ident.name.as_str(), sym::on_unimplemented.as_str(), 5);