Skip to content

Commit 2c4570c

Browse files
committed
hir: Preserve used syntax in TyKind::TraitObject
1 parent b62694b commit 2c4570c

File tree

4 files changed

+5
-5
lines changed

4 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
@@ -387,7 +387,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
387387
self.nested_elision_site_lts.append(&mut sub_visitor.all_lts());
388388
return;
389389
},
390-
TyKind::TraitObject(bounds, ref lt) => {
390+
TyKind::TraitObject(bounds, ref lt, _) => {
391391
if !lt.is_elided() {
392392
self.unelided_trait_object_lifetime = true;
393393
}

clippy_lints/src/types/borrowed_box.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, m
5050
// Originally reported as the issue #3128.
5151
let inner_snippet = snippet(cx, inner.span, "..");
5252
let suggestion = match &inner.kind {
53-
TyKind::TraitObject(bounds, lt_bound) if bounds.len() > 1 || !lt_bound.is_elided() => {
53+
TyKind::TraitObject(bounds, lt_bound, _) if bounds.len() > 1 || !lt_bound.is_elided() => {
5454
format!("&{}({})", ltopt, &inner_snippet)
5555
},
5656
TyKind::Path(qpath)
@@ -86,7 +86,7 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, m
8686
// Returns true if given type is `Any` trait.
8787
fn is_any_trait(t: &hir::Ty<'_>) -> bool {
8888
if_chain! {
89-
if let TyKind::TraitObject(ref traits, _) = t.kind;
89+
if let TyKind::TraitObject(ref traits, ..) = t.kind;
9090
if !traits.is_empty();
9191
// Only Send/Sync can be used as additional traits, so it is enough to
9292
// check only the first trait.

clippy_lints/src/types/mod.rs

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

914-
TyKind::TraitObject(ref param_bounds, _) => {
914+
TyKind::TraitObject(ref param_bounds, ..) => {
915915
let has_lifetime_parameters = param_bounds.iter().any(|bound| {
916916
bound
917917
.bound_generic_params

clippy_utils/src/hir_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
892892
TyKind::OpaqueDef(_, arg_list) => {
893893
self.hash_generic_args(arg_list);
894894
},
895-
TyKind::TraitObject(_, lifetime) => {
895+
TyKind::TraitObject(_, lifetime, _) => {
896896
self.hash_lifetime(lifetime);
897897
},
898898
TyKind::Typeof(anon_const) => {

0 commit comments

Comments
 (0)