File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
src/librustc/mir/interpret Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -406,22 +406,14 @@ impl<'tcx, Tag> Scalar<Tag> {
406
406
self . to_bits ( target_size) . expect ( "expected Raw bits but got a Pointer" )
407
407
}
408
408
409
- /// Do not call this method! Use either `assert_ptr` or `force_ptr`.
410
- /// This method is intentionally private, do not make it public.
411
409
#[ inline]
412
- fn to_ptr ( self ) -> InterpResult < ' tcx , Pointer < Tag > > {
410
+ pub fn assert_ptr ( self ) -> Pointer < Tag > {
413
411
match self {
414
- Scalar :: Raw { data : 0 , .. } => throw_unsup ! ( InvalidNullPointerUsage ) ,
415
- Scalar :: Raw { .. } => throw_unsup ! ( ReadBytesAsPointer ) ,
416
- Scalar :: Ptr ( p) => Ok ( p) ,
412
+ Scalar :: Ptr ( p) => p,
413
+ Scalar :: Raw { .. } => bug ! ( "expected a Pointer but got Raw bits" )
417
414
}
418
415
}
419
416
420
- #[ inline( always) ]
421
- pub fn assert_ptr ( self ) -> Pointer < Tag > {
422
- self . to_ptr ( ) . expect ( "expected a Pointer but got Raw bits" )
423
- }
424
-
425
417
/// Do not call this method! Dispatch based on the type instead.
426
418
#[ inline]
427
419
pub fn is_bits ( self ) -> bool {
You can’t perform that action at this time.
0 commit comments