PlaceElem<'tcx> should be Copy

This commit is contained in:
Santiago Pastorino 2019-10-11 16:19:48 -03:00
parent 10f12fe3e7
commit 0b5ee56da8
No known key found for this signature in database
GPG key ID: 88C941CDA1D46432

View file

@ -1824,6 +1824,8 @@ impl<V, T> ProjectionElem<V, T> {
/// and the index is a local.
pub type PlaceElem<'tcx> = ProjectionElem<Local, Ty<'tcx>>;
impl<'tcx> Copy for PlaceElem<'tcx> { }
// At least on 64 bit systems, `PlaceElem` should not be larger than two pointers.
#[cfg(target_arch = "x86_64")]
static_assert_size!(PlaceElem<'_>, 16);