about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-30 00:49:44 +0000
committerbors <bors@rust-lang.org>2024-05-30 00:49:44 +0000
commitcaa187f3bc9604c78dfbc3ffabbe1372cb528639 (patch)
tree901212f058b35670cfe3e98fed80d88f448fce86 /library/core/src
parent23ea77b8edc902f4a90cda62af66f8b300e5de54 (diff)
parentfdfffc0048c0c2ae6baedc007b20607f9f966188 (diff)
downloadrust-caa187f3bc9604c78dfbc3ffabbe1372cb528639.tar.gz
rust-caa187f3bc9604c78dfbc3ffabbe1372cb528639.zip
Auto merge of #125744 - fmease:rollup-ky7d098, r=fmease
Rollup of 7 pull requests

Successful merges:

 - #125653 (Migrate `run-make/const-prop-lint` to `rmake.rs`)
 - #125662 (Rewrite `fpic`, `simple-dylib` and `issue-37893` `run-make` tests in `rmake.rs` or ui test format)
 - #125699 (Streamline `x fmt` and improve its output)
 - #125701 ([ACP 362] genericize `ptr::from_raw_parts`)
 - #125723 (Migrate `run-make/crate-data-smoke` to `rmake.rs`)
 - #125733 (Add lang items for `AsyncFn*`, `Future`, `AsyncFnKindHelper`'s associated types)
 - #125734 (ast: Revert a breaking attribute visiting order change)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/future/future.rs2
-rw-r--r--library/core/src/ops/async_function.rs4
-rw-r--r--library/core/src/ptr/metadata.rs4
-rw-r--r--library/core/src/ptr/mod.rs8
-rw-r--r--library/core/src/str/converts.rs4
5 files changed, 13 insertions, 9 deletions
diff --git a/library/core/src/future/future.rs b/library/core/src/future/future.rs
index f965afc8a59..86963b548b9 100644
--- a/library/core/src/future/future.rs
+++ b/library/core/src/future/future.rs
@@ -35,7 +35,7 @@ use crate::task::{Context, Poll};
 pub trait Future {
     /// The type of value produced on completion.
     #[stable(feature = "futures_api", since = "1.36.0")]
-    #[rustc_diagnostic_item = "FutureOutput"]
+    #[cfg_attr(not(bootstrap), lang = "future_output")]
     type Output;
 
     /// Attempt to resolve the future to a final value, registering
diff --git a/library/core/src/ops/async_function.rs b/library/core/src/ops/async_function.rs
index 18bcee5a1c7..f4e9d1a63ac 100644
--- a/library/core/src/ops/async_function.rs
+++ b/library/core/src/ops/async_function.rs
@@ -26,6 +26,7 @@ pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
 pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
     /// Future returned by [`AsyncFnMut::async_call_mut`] and [`AsyncFn::async_call`].
     #[unstable(feature = "async_fn_traits", issue = "none")]
+    #[cfg_attr(not(bootstrap), lang = "call_ref_future")]
     type CallRefFuture<'a>: Future<Output = Self::Output>
     where
         Self: 'a;
@@ -46,10 +47,12 @@ pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
 pub trait AsyncFnOnce<Args: Tuple> {
     /// Future returned by [`AsyncFnOnce::async_call_once`].
     #[unstable(feature = "async_fn_traits", issue = "none")]
+    #[cfg_attr(not(bootstrap), lang = "call_once_future")]
     type CallOnceFuture: Future<Output = Self::Output>;
 
     /// Output type of the called closure's future.
     #[unstable(feature = "async_fn_traits", issue = "none")]
+    #[cfg_attr(not(bootstrap), lang = "async_fn_once_output")]
     type Output;
 
     /// Call the [`AsyncFnOnce`], returning a future which may move out of the called closure.
@@ -143,6 +146,7 @@ mod internal_implementation_detail {
         // `for<'env> fn() -> (&'env T, ...)`. This allows us to represent the binder
         // of the closure's self-capture, and these upvar types will be instantiated with
         // the `'closure_env` region provided to the associated type.
+        #[cfg_attr(not(bootstrap), lang = "async_fn_kind_upvars")]
         type Upvars<'closure_env, Inputs, Upvars, BorrowedUpvarsAsFnPtr>;
     }
 }
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs
index 8d75bd2e74c..78fe0c5add5 100644
--- a/library/core/src/ptr/metadata.rs
+++ b/library/core/src/ptr/metadata.rs
@@ -120,7 +120,7 @@ pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
 #[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
 #[inline]
 pub const fn from_raw_parts<T: ?Sized>(
-    data_pointer: *const (),
+    data_pointer: *const impl Thin,
     metadata: <T as Pointee>::Metadata,
 ) -> *const T {
     aggregate_raw_ptr(data_pointer, metadata)
@@ -134,7 +134,7 @@ pub const fn from_raw_parts<T: ?Sized>(
 #[rustc_const_unstable(feature = "ptr_metadata", issue = "81513")]
 #[inline]
 pub const fn from_raw_parts_mut<T: ?Sized>(
-    data_pointer: *mut (),
+    data_pointer: *mut impl Thin,
     metadata: <T as Pointee>::Metadata,
 ) -> *mut T {
     aggregate_raw_ptr(data_pointer, metadata)
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index d2bbdc84d4d..4213a9dedfe 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -565,7 +565,7 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
 #[rustc_allow_const_fn_unstable(ptr_metadata)]
 #[rustc_diagnostic_item = "ptr_null"]
 pub const fn null<T: ?Sized + Thin>() -> *const T {
-    from_raw_parts(without_provenance(0), ())
+    from_raw_parts(without_provenance::<()>(0), ())
 }
 
 /// Creates a null mutable raw pointer.
@@ -591,7 +591,7 @@ pub const fn null<T: ?Sized + Thin>() -> *const T {
 #[rustc_allow_const_fn_unstable(ptr_metadata)]
 #[rustc_diagnostic_item = "ptr_null_mut"]
 pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
-    from_raw_parts_mut(without_provenance_mut(0), ())
+    from_raw_parts_mut(without_provenance_mut::<()>(0), ())
 }
 
 /// Creates a pointer with the given address and no provenance.
@@ -835,7 +835,7 @@ pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T {
 #[rustc_allow_const_fn_unstable(ptr_metadata)]
 #[rustc_diagnostic_item = "ptr_slice_from_raw_parts"]
 pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
-    intrinsics::aggregate_raw_ptr(data, len)
+    from_raw_parts(data, len)
 }
 
 /// Forms a raw mutable slice from a pointer and a length.
@@ -881,7 +881,7 @@ pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
 #[rustc_const_unstable(feature = "const_slice_from_raw_parts_mut", issue = "67456")]
 #[rustc_diagnostic_item = "ptr_slice_from_raw_parts_mut"]
 pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
-    intrinsics::aggregate_raw_ptr(data, len)
+    from_raw_parts_mut(data, len)
 }
 
 /// Swaps the values at two mutable locations of the same type, without
diff --git a/library/core/src/str/converts.rs b/library/core/src/str/converts.rs
index b6ffb0a608d..397759bd5ca 100644
--- a/library/core/src/str/converts.rs
+++ b/library/core/src/str/converts.rs
@@ -222,7 +222,7 @@ pub const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
 #[rustc_const_unstable(feature = "str_from_raw_parts", issue = "119206")]
 pub const unsafe fn from_raw_parts<'a>(ptr: *const u8, len: usize) -> &'a str {
     // SAFETY: the caller must uphold the safety contract for `from_raw_parts`.
-    unsafe { &*ptr::from_raw_parts(ptr.cast(), len) }
+    unsafe { &*ptr::from_raw_parts(ptr, len) }
 }
 
 /// Creates an `&mut str` from a pointer and a length.
@@ -241,5 +241,5 @@ pub const unsafe fn from_raw_parts<'a>(ptr: *const u8, len: usize) -> &'a str {
 #[rustc_const_unstable(feature = "const_str_from_raw_parts_mut", issue = "119206")]
 pub const unsafe fn from_raw_parts_mut<'a>(ptr: *mut u8, len: usize) -> &'a mut str {
     // SAFETY: the caller must uphold the safety contract for `from_raw_parts_mut`.
-    unsafe { &mut *ptr::from_raw_parts_mut(ptr.cast(), len) }
+    unsafe { &mut *ptr::from_raw_parts_mut(ptr, len) }
 }