File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,11 @@ impl Types {
541
541
_ => None ,
542
542
} ) ;
543
543
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 ( ..) ) ;
544
549
if ty_ty. is_sized( cx. tcx. at( ty. span) , cx. param_env) ;
545
550
if let Ok ( ty_ty_size) = cx. layout_of( ty_ty) . map( |l| l. size. bytes( ) ) ;
546
551
if ty_ty_size <= self . vec_box_size_threshold;
Original file line number Diff line number Diff line change
1
+ trait T < ' a > { }
2
+
3
+ fn foo ( _: Vec < Box < dyn T < ' _ > > > ) { }
4
+
5
+ fn main ( ) {
6
+ foo ( vec ! [ ] ) ;
7
+ }
You can’t perform that action at this time.
0 commit comments