}
#[test]
-#[cfg(not(bootstrap))]
fn align_offset_zst_const() {
const {
// For pointers of stride = 0, the pointer is already aligned or it cannot be aligned at
}
#[test]
-#[cfg(not(bootstrap))]
fn align_offset_stride_one_const() {
const {
// For pointers of stride = 1, the pointer can always be aligned. The offset is equal to
}
#[test]
-#[cfg(not(bootstrap))]
fn align_offset_various_strides_const() {
const unsafe fn test_stride<T>(ptr: *const T, numptr: usize, align: usize) {
let mut expected = usize::MAX;
}
#[test]
-#[cfg(not(bootstrap))]
fn align_offset_with_provenance_const() {
const {
// On some platforms (e.g. msp430-none-elf), the alignment of `i32` is less than 4.
}
#[test]
-#[cfg(not(bootstrap))]
fn align_offset_issue_103361_const() {
#[cfg(target_pointer_width = "64")]
const SIZE: usize = 1 << 47;
}
#[test]
-#[cfg(not(bootstrap))]
fn is_aligned_const() {
const {
let data = 42;
}
}
-#[test]
-#[cfg(bootstrap)]
-fn is_aligned_const() {
- const {
- let data = 42;
- let ptr: *const i32 = &data;
- // The bootstrap compiler always returns false for is_aligned.
- assert!(!ptr.is_aligned());
- assert!(!ptr.is_aligned_to(1));
- }
-}
-
#[test]
fn offset_from() {
let mut a = [0; 5];
}
// "Synthetic" trait impls generated by the compiler like those of `Pointee`
// are not checked for bounds of associated type.
- // So with a buggy libcore we could have both:
+ // So with a buggy core we could have both:
// * `<dyn Display as Pointee>::Metadata == DynMetadata`
// * `DynMetadata: !PartialEq`
// … and cause an ICE here: