Box PatKind::Range.

Because it's the biggest variant. Also, make `PatRange` non-`Copy`,
because it's 104 bytes, which is pretty big.
This commit is contained in:
Nicholas Nethercote 2022-08-26 11:36:24 +10:00
parent bd1e6836a0
commit 2c4c8eb1a3
7 changed files with 34 additions and 26 deletions

View file

@ -157,7 +157,7 @@ impl<'a, 'tcx> AbstractConstBuilder<'a, 'tcx> {
match pat.kind {
thir::PatKind::Constant { value } => value.has_param_types_or_consts(),
thir::PatKind::Range(thir::PatRange { lo, hi, .. }) => {
thir::PatKind::Range(box thir::PatRange { lo, hi, .. }) => {
lo.has_param_types_or_consts() || hi.has_param_types_or_consts()
}
_ => false,