-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[DO NOT MERGE] Expand core's prelude with more types #125107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
020292c
b0b75de
bacb3e3
fcbcdd4
a222427
8b2e9b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,67 @@ pub use crate::option::Option::{self, None, Some}; | |
#[doc(no_inline)] | ||
pub use crate::result::Result::{self, Err, Ok}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::cell::{Cell, LazyCell, OnceCell, RefCell, SyncUnsafeCell, UnsafeCell}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::ffi::{ | ||
c_char, c_double, c_float, c_int, c_long, c_longlong, c_ptrdiff_t, c_schar, c_short, c_size_t, | ||
c_ssize_t, c_str, c_uchar, c_uint, c_ulong, c_ulonglong, c_ushort, c_void, CStr, | ||
}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::io::{BorrowedBuf, BorrowedCursor}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::marker::{PhantomData, PhantomPinned}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...yeah, really want these two. |
||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::mem::{ManuallyDrop, MaybeUninit}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::num::{ | ||
NonZero, NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, | ||
NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, | ||
}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::panic::PanicInfo; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::pin::Pin; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::ptr::NonNull; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::sync::atomic::{ | ||
AtomicBool, AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, | ||
AtomicU32, AtomicU64, AtomicU8, AtomicUsize, | ||
}; | ||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::time::Duration; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems like it would risk confusion because time::Duration exists. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That feels like an awkward one because, without further context, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right. and don't forget chrono::Duration. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I'm willing to see if crater has anything to say about this 😛 |
||
|
||
#[stable(feature = "core_prelude_extra", since = "CURRENT_RUSTC_VERSION")] | ||
#[doc(no_inline)] | ||
pub use crate::ops::ControlFlow; | ||
|
||
// Re-exported built-in macros | ||
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] | ||
#[doc(no_inline)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, the OnceCell case seems like it may risk confusion due to
once_cell
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I think that the parts of
once_cell
that overlap with std are considered deprecated in favour of std (MSRV willing).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the author basically contributed the code, so yeah.