diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-07-31 09:08:46 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-07-31 15:17:20 +1000 |
| commit | c78d589243cede0605a4ba26b452c50f4a09ccc3 (patch) | |
| tree | f90b53709aa9de46d3e547e5e1fa533ca2b168ff | |
| parent | 86ff11e729e780f533030208f1c0ab25e52e6f47 (diff) | |
Remove `TyCtxt::get_attrs_unchecked`.
It's identical to `TyCtxt::get_all_attrs` except it takes `DefId` instead of `impl Into<DefIf>`.
| -rw-r--r-- | clippy_lints/src/matches/significant_drop_in_scrutinee.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/significant_drop_tightening.rs | 2 | ||||
| -rw-r--r-- | clippy_utils/src/macros.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/clippy_lints/src/matches/significant_drop_in_scrutinee.rs b/clippy_lints/src/matches/significant_drop_in_scrutinee.rs index 88b4d9b7d54..027dd7ce053 100644 --- a/clippy_lints/src/matches/significant_drop_in_scrutinee.rs +++ b/clippy_lints/src/matches/significant_drop_in_scrutinee.rs @@ -185,7 +185,7 @@ impl<'a, 'tcx> SigDropChecker<'a, 'tcx> { 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() diff --git a/clippy_lints/src/significant_drop_tightening.rs b/clippy_lints/src/significant_drop_tightening.rs index 521754f7bab..9110f684bd1 100644 --- a/clippy_lints/src/significant_drop_tightening.rs +++ b/clippy_lints/src/significant_drop_tightening.rs @@ -168,7 +168,7 @@ impl<'cx, 'others, 'tcx> AttrChecker<'cx, 'others, 'tcx> { 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() { diff --git a/clippy_utils/src/macros.rs b/clippy_utils/src/macros.rs index ba126fcd05d..60473a26493 100644 --- a/clippy_utils/src/macros.rs +++ b/clippy_utils/src/macros.rs @@ -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() } } |
