Skip to content

Commit 5c4e940

Browse files
committed
Make hir::TyKind::TraitObject use tagged ptr
1 parent de12d28 commit 5c4e940

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

clippy_lints/src/lifetimes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ impl<'tcx> Visitor<'tcx> for RefVisitor<'_, 'tcx> {
433433
sub_visitor.visit_fn_decl(decl);
434434
self.nested_elision_site_lts.append(&mut sub_visitor.all_lts());
435435
},
436-
TyKind::TraitObject(bounds, lt, _) => {
436+
TyKind::TraitObject(bounds, lt) => {
437437
if !lt.is_elided() {
438438
self.unelided_trait_object_lifetime = true;
439439
}

clippy_lints/src/types/borrowed_box.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, m
4747
// Originally reported as the issue #3128.
4848
let inner_snippet = snippet(cx, inner.span, "..");
4949
let suggestion = match &inner.kind {
50-
TyKind::TraitObject(bounds, lt_bound, _) if bounds.len() > 1 || !lt_bound.is_elided() => {
50+
TyKind::TraitObject(bounds, lt_bound) if bounds.len() > 1 || !lt_bound.is_elided() => {
5151
format!("&{ltopt}({inner_snippet})")
5252
},
5353
TyKind::Path(qpath)

clippy_lints/src/types/type_complexity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ impl<'tcx> Visitor<'tcx> for TypeComplexityVisitor {
5252
// function types bring a lot of overhead
5353
TyKind::BareFn(bare) if bare.abi == Abi::Rust => (50 * self.nest, 1),
5454

55-
TyKind::TraitObject(param_bounds, _, _) => {
55+
TyKind::TraitObject(param_bounds, _) => {
5656
let has_lifetime_parameters = param_bounds.iter().any(|bound| {
5757
bound
5858
.bound_generic_params

clippy_utils/src/check_proc_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ fn ty_search_pat(ty: &Ty<'_>) -> (Pat, Pat) {
400400
TyKind::OpaqueDef(..) => (Pat::Str("impl"), Pat::Str("")),
401401
TyKind::Path(qpath) => qpath_search_pat(&qpath),
402402
TyKind::Infer => (Pat::Str("_"), Pat::Str("_")),
403-
TyKind::TraitObject(_, _, TraitObjectSyntax::Dyn) => (Pat::Str("dyn"), Pat::Str("")),
403+
TyKind::TraitObject(_, tagged_ptr) if let TraitObjectSyntax::Dyn = tagged_ptr.tag() => (Pat::Str("dyn"), Pat::Str("")),
404404
// NOTE: `TraitObject` is incomplete. It will always return true then.
405405
_ => (Pat::Str(""), Pat::Str("")),
406406
}

clippy_utils/src/hir_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
12811281
}
12821282
},
12831283
TyKind::Path(qpath) => self.hash_qpath(qpath),
1284-
TyKind::TraitObject(_, lifetime, _) => {
1284+
TyKind::TraitObject(_, lifetime) => {
12851285
self.hash_lifetime(lifetime);
12861286
},
12871287
TyKind::Typeof(anon_const) => {

0 commit comments

Comments
 (0)