Repository: rust-lang/rust
File: compiler/rustc_const_eval/src/const_eval/type_info.rs (Rust)

Code before:
                        }
                        ty::RawPtr(ty, mutability) => {
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::Pointer)?;
                            let pointer_place =
                                self.project_field(&variant_place, FieldIdx::ZERO)?;

                            self.write_pointer_type_info(pointer_place, *ty, *mutability)?;

                            variant
                        }
                        ty::Dynamic(predicates, region) => {
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::DynTrait)?;
                            let dyn_place = self.project_field(&variant_place, FieldIdx::ZERO)?;
                            self.write_dyn_trait_type_info(dyn_place, *predicates, *region)?;
                            variant
                        }
                        ty::FnPtr(binder, FnHeader { safety, c_variadic, abi }) => {
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::FnPtr)?;
                            let fn_ptr_place =
                                self.project_field(&variant_place, FieldIdx::ZERO)?;
                            self.write_fn_ptr_type_info(
                                fn_ptr_place,
                                binder.skip_binder().output(),
                                safety.is_unsafe(),
                                *c_variadic,
                                (!abi.is_rustic_abi()).then_some(abi.as_str()),
                                binder.skip_binder().inputs(),
                            )?;
                            variant
                        }
                        ty::Foreign(_)
                        | ty::Pat(_, _)
                        | ty::FnDef(..)
                        | ty::UnsafeBinder(..)
                        | ty::Closure(..)
                        | ty::CoroutineClosure(..)
                        | ty::Coroutine(..)
                        | ty::CoroutineWitness(..)
                        | ty::Never
                        | ty::Alias(..)
                        | ty::Param(_)
                        | ty::Bound(..)
                        | ty::Placeholder(_)
                        | ty::Infer(..)
                        | ty::Error(_) => self.downcast(&field_dest, sym::Other)?.0,
                    };
                    self.write_discriminant(variant_index, &field_dest)?
                }

Review comment (suggestion):
Move the skip_binder calls all into one at the start of the arm and leave a FIXME for handling bound lifetimes potentially in the future 

Code after:
                        }
                        ty::RawPtr(ty, mutability) => {
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::Pointer)?;
                            let pointer_place =
                                self.project_field(&variant_place, FieldIdx::ZERO)?;

                            self.write_pointer_type_info(pointer_place, *ty, *mutability)?;

                            variant
                        }
                        ty::Dynamic(predicates, region) => {
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::DynTrait)?;
                            let dyn_place = self.project_field(&variant_place, FieldIdx::ZERO)?;
                            self.write_dyn_trait_type_info(dyn_place, *predicates, *region)?;
                            variant
                        }
                        ty::FnPtr(sig, fn_header) => {
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::FnPtr)?;
                            let fn_ptr_place =
                                self.project_field(&variant_place, FieldIdx::ZERO)?;

                            // FIXME: handle lifetime bounds
                            let sig = sig.skip_binder();

                            self.write_fn_ptr_type_info(fn_ptr_place, &sig, fn_header)?;
                            variant
                        }
                        ty::Foreign(_)
                        | ty::Pat(_, _)
                        | ty::FnDef(..)
                        | ty::UnsafeBinder(..)
                        | ty::Closure(..)
                        | ty::CoroutineClosure(..)
                        | ty::Coroutine(..)
                        | ty::CoroutineWitness(..)
                        | ty::Never
                        | ty::Alias(..)
                        | ty::Param(_)
                        | ty::Bound(..)
                        | ty::Placeholder(_)
                        | ty::Infer(..)
                        | ty::Error(_) => self.downcast(&field_dest, sym::Other)?.0,
                    };
                    self.write_discriminant(variant_index, &field_dest)?
                }
                sym::size => {
                    let layout = self.layout_of(ty)?;
                    let variant_index = if layout.is_sized() {