don't skip inference for type in offset_of!
This commit is contained in:
parent
6d1bf733d6
commit
7cdb23b98a
8 changed files with 42 additions and 16 deletions
|
@ -692,15 +692,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
|||
fcx_typeck_results.offset_of_data().items_in_stable_order()
|
||||
{
|
||||
let hir_id = hir::HirId { owner: common_hir_owner, local_id };
|
||||
|
||||
if cfg!(debug_assertions) && container.has_infer() {
|
||||
span_bug!(
|
||||
hir_id.to_span(self.fcx.tcx),
|
||||
"writeback: `{:?}` has inference variables",
|
||||
container
|
||||
);
|
||||
};
|
||||
|
||||
let container = self.resolve(container, &hir_id);
|
||||
self.typeck_results.offset_of_data_mut().insert(hir_id, (container, indices.clone()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -481,10 +481,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
}))))
|
||||
}
|
||||
|
||||
ExprKind::OffsetOf { container, fields } => block.and(Rvalue::NullaryOp(
|
||||
NullOp::OffsetOf(fields),
|
||||
this.tcx.erase_regions(container),
|
||||
)),
|
||||
ExprKind::OffsetOf { container, fields } => {
|
||||
block.and(Rvalue::NullaryOp(NullOp::OffsetOf(fields), container))
|
||||
}
|
||||
|
||||
ExprKind::Literal { .. }
|
||||
| ExprKind::NamedConst { .. }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue