Add warning label to try_as_mplace
This commit is contained in:
parent
a1990db7c6
commit
f7f59522b6
1 changed files with 4 additions and 0 deletions
|
@ -241,6 +241,8 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
|
||||||
// These are defined here because they produce a place.
|
// These are defined here because they produce a place.
|
||||||
impl<'tcx, Tag: ::std::fmt::Debug + Copy> OpTy<'tcx, Tag> {
|
impl<'tcx, Tag: ::std::fmt::Debug + Copy> OpTy<'tcx, Tag> {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
/// Note: do not call `as_ref` on the resulting place. This function should only be used to
|
||||||
|
/// read from the resulting mplace, not to get its address back.
|
||||||
pub fn try_as_mplace(
|
pub fn try_as_mplace(
|
||||||
self,
|
self,
|
||||||
cx: &impl HasDataLayout,
|
cx: &impl HasDataLayout,
|
||||||
|
@ -255,6 +257,8 @@ impl<'tcx, Tag: ::std::fmt::Debug + Copy> OpTy<'tcx, Tag> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
|
/// Note: do not call `as_ref` on the resulting place. This function should only be used to
|
||||||
|
/// read from the resulting mplace, not to get its address back.
|
||||||
pub fn assert_mem_place(self, cx: &impl HasDataLayout) -> MPlaceTy<'tcx, Tag> {
|
pub fn assert_mem_place(self, cx: &impl HasDataLayout) -> MPlaceTy<'tcx, Tag> {
|
||||||
self.try_as_mplace(cx).unwrap()
|
self.try_as_mplace(cx).unwrap()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue