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 {
1384
1384
pub const fn is_aligned_to ( self , align : usize ) -> bool {
1385
1385
assert ! ( align. is_power_of_two( ) , "is_aligned_to: align is not a power-of-two" ) ;
1386
1386
1387
+ #[ inline]
1387
1388
fn runtime ( ptr : * const u8 , align : usize ) -> bool {
1388
1389
ptr. addr ( ) & ( align - 1 ) == 0
1389
1390
}
Original file line number Diff line number Diff line change @@ -1655,6 +1655,7 @@ impl<T: ?Sized> *mut T {
1655
1655
pub const fn is_aligned_to ( self , align : usize ) -> bool {
1656
1656
assert ! ( align. is_power_of_two( ) , "is_aligned_to: align is not a power-of-two" ) ;
1657
1657
1658
+ #[ inline]
1658
1659
fn runtime ( ptr : * mut u8 , align : usize ) -> bool {
1659
1660
ptr. addr ( ) & ( align - 1 ) == 0
1660
1661
}
Original file line number Diff line number Diff line change 17
17
#![ feature( const_nonnull_new) ]
18
18
#![ feature( const_num_from_num) ]
19
19
#![ feature( const_pointer_byte_offsets) ]
20
- #![ feature( const_pointer_is_aligned) ]
20
+ #![ cfg_attr ( not ( bootstrap ) , feature( const_pointer_is_aligned) ) ]
21
21
#![ feature( const_ptr_as_ref) ]
22
22
#![ feature( const_ptr_read) ]
23
23
#![ feature( const_ptr_write) ]
Original file line number Diff line number Diff line change @@ -359,6 +359,7 @@ fn align_offset_zst() {
359
359
}
360
360
361
361
#[ test]
362
+ #[ cfg( not( bootstrap) ) ]
362
363
fn align_offset_zst_const ( ) {
363
364
const {
364
365
// 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() {
396
397
}
397
398
398
399
#[ test]
400
+ #[ cfg( not( bootstrap) ) ]
399
401
fn align_offset_stride_one_const ( ) {
400
402
const {
401
403
// 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() {
491
493
}
492
494
493
495
#[ test]
496
+ #[ cfg( not( bootstrap) ) ]
494
497
fn align_offset_various_strides_const ( ) {
495
498
const unsafe fn test_stride < T > ( ptr : * const T , numptr : usize , align : usize ) {
496
499
let mut expected = usize:: MAX ;
@@ -554,6 +557,7 @@ fn align_offset_various_strides_const() {
554
557
}
555
558
556
559
#[ test]
560
+ #[ cfg( not( bootstrap) ) ]
557
561
fn align_offset_with_provenance_const ( ) {
558
562
const {
559
563
let data = 42 ;
@@ -633,6 +637,7 @@ fn is_aligned() {
633
637
}
634
638
635
639
#[ test]
640
+ #[ cfg( not( bootstrap) ) ]
636
641
fn is_aligned_const ( ) {
637
642
const {
638
643
let data = 42 ;
You can’t perform that action at this time.
0 commit comments