Remove TyCtxt::get_attrs_unchecked.

It's identical to `TyCtxt::get_all_attrs` except it takes `DefId`
instead of `impl Into<DefIf>`.
This commit is contained in:
Nicholas Nethercote
2025-07-31 09:08:46 +10:00
parent 86ff11e729
commit c78d589243
3 changed files with 3 additions and 3 deletions
@@ -185,7 +185,7 @@ fn has_sig_drop_attr_impl(&mut self, ty: Ty<'tcx>) -> bool {
if let Some(adt) = ty.ty_adt_def()
&& get_attr(
self.cx.sess(),
self.cx.tcx.get_attrs_unchecked(adt.did()),
self.cx.tcx.get_all_attrs(adt.did()),
sym::has_significant_drop,
)
.count()
@@ -168,7 +168,7 @@ fn has_sig_drop_attr_uncached(&mut self, ty: Ty<'tcx>, depth: usize) -> bool {
if let Some(adt) = ty.ty_adt_def() {
let mut iter = get_attr(
self.cx.sess(),
self.cx.tcx.get_attrs_unchecked(adt.did()),
self.cx.tcx.get_all_attrs(adt.did()),
sym::has_significant_drop,
);
if iter.next().is_some() {
+1 -1
View File
@@ -42,7 +42,7 @@ pub fn is_format_macro(cx: &LateContext<'_>, macro_def_id: DefId) -> bool {
} else {
// Allow users to tag any macro as being format!-like
// TODO: consider deleting FORMAT_MACRO_DIAG_ITEMS and using just this method
get_unique_attr(cx.sess(), cx.tcx.get_attrs_unchecked(macro_def_id), sym::format_args).is_some()
get_unique_attr(cx.sess(), cx.tcx.get_all_attrs(macro_def_id), sym::format_args).is_some()
}
}