Skip to content

Commit 03a6d8e

Browse files
authoredNov 11, 2016
Rollup merge of rust-lang#37705 - nnethercote:fewer-mk_ty-calls, r=brson
Avoid unnecessary mk_ty calls in Ty::super_fold_with. This speeds up compilation of several rustc-benchmarks by 1--2% and the workload in rust-lang#36799 by 5%. r? @eddyb
2 parents 0db7d5a + 11c1126 commit 03a6d8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/librustc/ty/structural_impls.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ impl<'tcx> TypeFoldable<'tcx> for Ty<'tcx> {
482482
ty::TyAnon(did, substs) => ty::TyAnon(did, substs.fold_with(folder)),
483483
ty::TyBool | ty::TyChar | ty::TyStr | ty::TyInt(_) |
484484
ty::TyUint(_) | ty::TyFloat(_) | ty::TyError | ty::TyInfer(_) |
485-
ty::TyParam(..) | ty::TyNever => self.sty.clone(),
485+
ty::TyParam(..) | ty::TyNever => return self
486486
};
487487
folder.tcx().mk_ty(sty)
488488
}

0 commit comments

Comments
 (0)