]> git.lizzy.rs Git - rust.git/blobdiff - library/core/tests/ptr.rs
Rollup merge of #106310 - compiler-errors:old-git, r=jyn514
[rust.git] / library / core / tests / ptr.rs
index 90bc83510803f2185d4f8a3ec83e19343cc5eda8..80d30f14c66b24d137dbbea5270566051eda363e 100644 (file)
@@ -359,7 +359,6 @@ fn align_offset_zst() {
 }
 
 #[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
@@ -397,7 +396,6 @@ fn align_offset_stride_one() {
 }
 
 #[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
@@ -493,7 +491,6 @@ unsafe fn test_stride<T>(ptr: *const T, align: usize) -> bool {
 }
 
 #[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;
@@ -561,7 +558,6 @@ fn align_offset_various_strides_const() {
 }
 
 #[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.
@@ -681,7 +677,6 @@ fn align_offset_issue_103361() {
 }
 
 #[test]
-#[cfg(not(bootstrap))]
 fn align_offset_issue_103361_const() {
     #[cfg(target_pointer_width = "64")]
     const SIZE: usize = 1 << 47;
@@ -715,7 +710,6 @@ fn is_aligned() {
 }
 
 #[test]
-#[cfg(not(bootstrap))]
 fn is_aligned_const() {
     const {
         let data = 42;
@@ -734,18 +728,6 @@ fn is_aligned_const() {
     }
 }
 
-#[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];
@@ -825,7 +807,7 @@ fn metadata_eq_method_address<T: ?Sized>() -> usize {
     }
     // "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: