Rollup merge of #111661 - clubby789:offset-of-erase-regions, r=compiler-errors
Erase regions of type in `offset_of!` Fixes #111657
This commit is contained in:
commit
0720743836
@ -481,9 +481,10 @@ pub(crate) fn as_rvalue(
|
||||
}))))
|
||||
}
|
||||
|
||||
ExprKind::OffsetOf { container, fields } => {
|
||||
block.and(Rvalue::NullaryOp(NullOp::OffsetOf(fields), container))
|
||||
}
|
||||
ExprKind::OffsetOf { container, fields } => block.and(Rvalue::NullaryOp(
|
||||
NullOp::OffsetOf(fields),
|
||||
this.tcx.erase_regions(container),
|
||||
)),
|
||||
|
||||
ExprKind::Literal { .. }
|
||||
| ExprKind::NamedConst { .. }
|
||||
|
@ -12,6 +12,11 @@ fn main() {
|
||||
offset_of!(S, f.,); //~ ERROR expected identifier
|
||||
offset_of!(S, f..); //~ ERROR no rules expected the token
|
||||
offset_of!(S, f..,); //~ ERROR no rules expected the token
|
||||
offset_of!(Lt<'static>, bar); // issue #111657
|
||||
|
||||
}
|
||||
|
||||
struct S { f: u8, }
|
||||
struct Lt<'a> {
|
||||
bar: &'a (),
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user