Skip to content

Commit c78d589

Browse files
committed
Remove TyCtxt::get_attrs_unchecked.
It's identical to `TyCtxt::get_all_attrs` except it takes `DefId` instead of `impl Into<DefIf>`.
1 parent 86ff11e commit c78d589

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

clippy_lints/src/matches/significant_drop_in_scrutinee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<'a, 'tcx> SigDropChecker<'a, 'tcx> {
185185
if let Some(adt) = ty.ty_adt_def()
186186
&& get_attr(
187187
self.cx.sess(),
188-
self.cx.tcx.get_attrs_unchecked(adt.did()),
188+
self.cx.tcx.get_all_attrs(adt.did()),
189189
sym::has_significant_drop,
190190
)
191191
.count()

clippy_lints/src/significant_drop_tightening.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<'cx, 'others, 'tcx> AttrChecker<'cx, 'others, 'tcx> {
168168
if let Some(adt) = ty.ty_adt_def() {
169169
let mut iter = get_attr(
170170
self.cx.sess(),
171-
self.cx.tcx.get_attrs_unchecked(adt.did()),
171+
self.cx.tcx.get_all_attrs(adt.did()),
172172
sym::has_significant_drop,
173173
);
174174
if iter.next().is_some() {

clippy_utils/src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn is_format_macro(cx: &LateContext<'_>, macro_def_id: DefId) -> bool {
4242
} else {
4343
// Allow users to tag any macro as being format!-like
4444
// TODO: consider deleting FORMAT_MACRO_DIAG_ITEMS and using just this method
45-
get_unique_attr(cx.sess(), cx.tcx.get_attrs_unchecked(macro_def_id), sym::format_args).is_some()
45+
get_unique_attr(cx.sess(), cx.tcx.get_all_attrs(macro_def_id), sym::format_args).is_some()
4646
}
4747
}
4848

0 commit comments

Comments
 (0)