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

Code before:
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::Reference)?;
                            let reference_place =
                                self.project_field(&variant_place, FieldIdx::ZERO)?;
                            self.write_reference_type_info(reference_place, *ty, *mutability)?;

                            variant
                        }
                        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(_)

Review comment (suggestion):
```suggestion
                        ty::FnPtr(sig, FnHeader { safety, c_variadic, abi }) => {
```

Code after:
                            let (variant, variant_place) =
                                self.downcast(&field_dest, sym::Reference)?;
                            let reference_place =
                                self.project_field(&variant_place, FieldIdx::ZERO)?;
                            self.write_reference_type_info(reference_place, *ty, *mutability)?;

                            variant
                        }
                        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(..)