mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
Avoid a FnPtr deconstruct-and-recreate.
This commit is contained in:
@@ -986,10 +986,11 @@ fn ty_and_layout_pointee_info_at(
|
||||
safe: None,
|
||||
})
|
||||
}
|
||||
ty::FnPtr(sig_tys, hdr) if offset.bytes() == 0 => {
|
||||
let fn_sig = sig_tys.with(hdr);
|
||||
tcx.layout_of(param_env.and(Ty::new_fn_ptr(tcx, fn_sig))).ok().map(|layout| {
|
||||
PointeeInfo { size: layout.size, align: layout.align.abi, safe: None }
|
||||
ty::FnPtr(..) if offset.bytes() == 0 => {
|
||||
tcx.layout_of(param_env.and(this.ty)).ok().map(|layout| PointeeInfo {
|
||||
size: layout.size,
|
||||
align: layout.align.abi,
|
||||
safe: None,
|
||||
})
|
||||
}
|
||||
ty::Ref(_, ty, mt) if offset.bytes() == 0 => {
|
||||
|
||||
Reference in New Issue
Block a user