1
Fork 0

Normalize before checking if local is freeze in deduced_param_attrs

This commit is contained in:
Michael Goulet 2023-08-17 14:33:24 -07:00
parent 0768872680
commit 20c648c582
2 changed files with 185 additions and 1 deletions

View file

@ -203,7 +203,12 @@ pub fn deduced_param_attrs<'tcx>(
body.local_decls.iter().skip(1).take(body.arg_count).enumerate().map(
|(arg_index, local_decl)| DeducedParamAttrs {
read_only: !deduce_read_only.mutable_args.contains(arg_index)
&& local_decl.ty.is_freeze(tcx, param_env),
// We must normalize here to reveal opaques and normalize
// their substs, otherwise we'll see exponential blow-up in
// compile times: #113372
&& tcx
.normalize_erasing_regions(param_env, local_decl.ty)
.is_freeze(tcx, param_env),
},
),
);