mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
add track_caller to some interpreter functions
This commit is contained in:
parent
5b8cf49c51
commit
dfd243e27c
@ -71,6 +71,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
pub fn to_scalar_or_uninit(self) -> ScalarMaybeUninit<Tag> {
|
||||
match self {
|
||||
Immediate::Scalar(val) => val,
|
||||
@ -79,11 +80,13 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
pub fn to_scalar(self) -> InterpResult<'tcx, Scalar<Tag>> {
|
||||
self.to_scalar_or_uninit().check_init()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
pub fn to_scalar_or_uninit_pair(self) -> (ScalarMaybeUninit<Tag>, ScalarMaybeUninit<Tag>) {
|
||||
match self {
|
||||
Immediate::ScalarPair(val1, val2) => (val1, val2),
|
||||
@ -92,6 +95,7 @@ impl<'tcx, Tag: Provenance> Immediate<Tag> {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
#[track_caller]
|
||||
pub fn to_scalar_pair(self) -> InterpResult<'tcx, (Scalar<Tag>, Scalar<Tag>)> {
|
||||
let (val1, val2) = self.to_scalar_or_uninit_pair();
|
||||
Ok((val1.check_init()?, val2.check_init()?))
|
||||
|
Loading…
Reference in New Issue
Block a user