Support enum variants in offset_of!
This commit is contained in:
parent
9d83ac2179
commit
e936416a8d
27 changed files with 472 additions and 75 deletions
|
@ -670,7 +670,7 @@ impl<'tcx> Cx<'tcx> {
|
|||
hir::ExprKind::OffsetOf(_, _) => {
|
||||
let data = self.typeck_results.offset_of_data();
|
||||
let &(container, ref indices) = data.get(expr.hir_id).unwrap();
|
||||
let fields = tcx.mk_fields_from_iter(indices.iter().copied());
|
||||
let fields = tcx.mk_offset_of_from_iter(indices.iter().copied());
|
||||
|
||||
ExprKind::OffsetOf { container, fields }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue