Skip to content

Commit a98f9d2

Browse files
committed
(Hacky) Fix for ICE rust-lang#6139
1 parent 6d88803 commit a98f9d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clippy_lints/src/types.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ impl Types {
541541
_ => None,
542542
});
543543
let ty_ty = hir_ty_to_ty(cx.tcx, boxed_ty);
544+
// HACK(flip1995): This is a fix for an ICE occuring when `ty_ty` is a
545+
// trait object with a lifetime, e.g. `dyn T<'_>`. Since trait objects
546+
// don't have a known size, this shouldn't introduce FNs. But there
547+
// should be a better solution.
548+
if !matches!(ty_ty.kind(), ty::Dynamic(..));
544549
if ty_ty.is_sized(cx.tcx.at(ty.span), cx.param_env);
545550
if let Ok(ty_ty_size) = cx.layout_of(ty_ty).map(|l| l.size.bytes());
546551
if ty_ty_size <= self.vec_box_size_threshold;

0 commit comments

Comments
 (0)