Skip to content

Commit ce22fd3

Browse files
Remove redundant in_trait from hir::TyKind::OpaqueDef
1 parent 4891dd4 commit ce22fd3

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

clippy_lints/src/extra_unused_type_parameters.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for TypeWalker<'cx, 'tcx> {
199199
fn visit_ty(&mut self, t: &'tcx Ty<'tcx>) {
200200
if let Some((def_id, _)) = t.peel_refs().as_generic_param() {
201201
self.ty_params.remove(&def_id);
202-
} else if let TyKind::OpaqueDef(id, _, _) = t.kind {
202+
} else if let TyKind::OpaqueDef(id, _) = t.kind {
203203
// Explicitly walk OpaqueDef. Normally `walk_ty` would do the job, but it calls
204204
// `visit_nested_item`, which checks that `Self::NestedFilter::INTER` is set. We're
205205
// using `OnlyBodies`, so the check ends up failing and the type isn't fully walked.

clippy_lints/src/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
523523

524524
fn visit_ty(&mut self, ty: &'tcx Ty<'_>) {
525525
match ty.kind {
526-
TyKind::OpaqueDef(item, bounds, _) => {
526+
TyKind::OpaqueDef(item, bounds) => {
527527
let map = self.cx.tcx.hir();
528528
let item = map.item(item);
529529
let len = self.lts.len();

clippy_lints/src/manual_async_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fn future_trait_ref<'tcx>(
105105
cx: &LateContext<'tcx>,
106106
ty: &'tcx Ty<'tcx>,
107107
) -> Option<(&'tcx TraitRef<'tcx>, Vec<LifetimeName>)> {
108-
if let TyKind::OpaqueDef(item_id, bounds, false) = ty.kind
108+
if let TyKind::OpaqueDef(item_id, bounds) = ty.kind
109109
&& let item = cx.tcx.hir().item(item_id)
110110
&& let ItemKind::OpaqueTy(opaque) = &item.kind
111111
&& let Some(trait_ref) = opaque.bounds.iter().find_map(|bound| {

clippy_utils/src/hir_utils.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,9 +1115,8 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
11151115
}
11161116
},
11171117
TyKind::Path(ref qpath) => self.hash_qpath(qpath),
1118-
TyKind::OpaqueDef(_, arg_list, in_trait) => {
1118+
TyKind::OpaqueDef(_, arg_list) => {
11191119
self.hash_generic_args(arg_list);
1120-
in_trait.hash(&mut self.s);
11211120
},
11221121
TyKind::TraitObject(_, lifetime, _) => {
11231122
self.hash_lifetime(lifetime);

0 commit comments

Comments
 (0)