diff options
| author | bors <bors@rust-lang.org> | 2023-12-04 19:46:46 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-12-04 19:46:46 +0000 |
| commit | a28077b28a02b92985b3a3faecf92813155f1ea1 (patch) | |
| tree | 2b3b10b83a2f87104f139d2e634ac83a9cc38066 /compiler/rustc_mir_transform/src/inline.rs | |
| parent | 79e9716c980570bfd1f666e3b16ac583f0168962 (diff) | |
| parent | de148ecd5c7b1675460843a8a35a370e4360a257 (diff) | |
| download | rust-1.74.1.tar.gz rust-1.74.1.zip | |
Auto merge of #118607 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum 1.74.1
[stable] 1.74.1 release This includes backports of: * Dispose llvm::TargetMachines prior to llvm::Context being disposed #118464 * clarify fn discriminant guarantees: only free lifetimes may get erased #118006 * Move subtyper below reveal_all and change reveal_all #116415 * Make subtyping explicit in MIR #115025 (needed for above) As well as infrastructure fix: * Don't ask for a specific branch in cargotest #118597 r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_mir_transform/src/inline.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/inline.rs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs index ebd61f8ad95..b53e0852c09 100644 --- a/compiler/rustc_mir_transform/src/inline.rs +++ b/compiler/rustc_mir_transform/src/inline.rs @@ -218,7 +218,13 @@ impl<'tcx> Inliner<'tcx> { // Normally, this shouldn't be required, but trait normalization failure can create a // validation ICE. let output_type = callee_body.return_ty(); - if !util::is_subtype(self.tcx, self.param_env, output_type, destination_ty) { + if !util::relate_types( + self.tcx, + self.param_env, + ty::Variance::Covariant, + output_type, + destination_ty, + ) { trace!(?output_type, ?destination_ty); return Err("failed to normalize return type"); } @@ -248,7 +254,13 @@ impl<'tcx> Inliner<'tcx> { self_arg_ty.into_iter().chain(arg_tuple_tys).zip(callee_body.args_iter()) { let input_type = callee_body.local_decls[input].ty; - if !util::is_subtype(self.tcx, self.param_env, input_type, arg_ty) { + if !util::relate_types( + self.tcx, + self.param_env, + ty::Variance::Covariant, + input_type, + arg_ty, + ) { trace!(?arg_ty, ?input_type); return Err("failed to normalize tuple argument type"); } @@ -257,7 +269,13 @@ impl<'tcx> Inliner<'tcx> { for (arg, input) in args.iter().zip(callee_body.args_iter()) { let input_type = callee_body.local_decls[input].ty; let arg_ty = arg.ty(&caller_body.local_decls, self.tcx); - if !util::is_subtype(self.tcx, self.param_env, input_type, arg_ty) { + if !util::relate_types( + self.tcx, + self.param_env, + ty::Variance::Covariant, + input_type, + arg_ty, + ) { trace!(?arg_ty, ?input_type); return Err("failed to normalize argument type"); } |
