File tree Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1384,6 +1384,7 @@ impl<T: ?Sized> *const T {
13841384 pub const fn is_aligned_to ( self , align : usize ) -> bool {
13851385 assert ! ( align. is_power_of_two( ) , "is_aligned_to: align is not a power-of-two" ) ;
13861386
1387+ #[ inline]
13871388 fn runtime ( ptr : * const u8 , align : usize ) -> bool {
13881389 ptr. addr ( ) & ( align - 1 ) == 0
13891390 }
Original file line number Diff line number Diff line change @@ -1655,6 +1655,7 @@ impl<T: ?Sized> *mut T {
16551655 pub const fn is_aligned_to ( self , align : usize ) -> bool {
16561656 assert ! ( align. is_power_of_two( ) , "is_aligned_to: align is not a power-of-two" ) ;
16571657
1658+ #[ inline]
16581659 fn runtime ( ptr : * mut u8 , align : usize ) -> bool {
16591660 ptr. addr ( ) & ( align - 1 ) == 0
16601661 }
Original file line number Diff line number Diff line change 1717#![ feature( const_nonnull_new) ]
1818#![ feature( const_num_from_num) ]
1919#![ feature( const_pointer_byte_offsets) ]
20- #![ feature( const_pointer_is_aligned) ]
20+ #![ cfg_attr ( not ( bootstrap ) , feature( const_pointer_is_aligned) ) ]
2121#![ feature( const_ptr_as_ref) ]
2222#![ feature( const_ptr_read) ]
2323#![ feature( const_ptr_write) ]
Original file line number Diff line number Diff line change @@ -359,6 +359,7 @@ fn align_offset_zst() {
359359}
360360
361361#[ test]
362+ #[ cfg( not( bootstrap) ) ]
362363fn align_offset_zst_const ( ) {
363364 const {
364365 // For pointers of stride = 0, the pointer is already aligned or it cannot be aligned at
@@ -396,6 +397,7 @@ fn align_offset_stride_one() {
396397}
397398
398399#[ test]
400+ #[ cfg( not( bootstrap) ) ]
399401fn align_offset_stride_one_const ( ) {
400402 const {
401403 // For pointers of stride = 1, the pointer can always be aligned. The offset is equal to
@@ -491,6 +493,7 @@ fn align_offset_various_strides() {
491493}
492494
493495#[ test]
496+ #[ cfg( not( bootstrap) ) ]
494497fn align_offset_various_strides_const ( ) {
495498 const unsafe fn test_stride < T > ( ptr : * const T , numptr : usize , align : usize ) {
496499 let mut expected = usize:: MAX ;
@@ -554,6 +557,7 @@ fn align_offset_various_strides_const() {
554557}
555558
556559#[ test]
560+ #[ cfg( not( bootstrap) ) ]
557561fn align_offset_with_provenance_const ( ) {
558562 const {
559563 let data = 42 ;
@@ -633,6 +637,7 @@ fn is_aligned() {
633637}
634638
635639#[ test]
640+ #[ cfg( not( bootstrap) ) ]
636641fn is_aligned_const ( ) {
637642 const {
638643 let data = 42 ;
You can’t perform that action at this time.
0 commit comments