Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unrolled build for rust-lang#123042
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#123042 - dpaoliello:prelude, r=Nilstrieb

Import the 2021 prelude in the core crate

The `core` crate currently imports the v1 prelude
https://github.com/rust-lang/rust/blob/b3df0d7e5ef5f7dbeeca3fb289c65680ad013f87/library/core/src/lib.rs#L285-L287

This recently caused an issue when updating the `portable-simd` subtree since it was using a trait that was added to the 2021 prelude: rust-lang#122905 (comment)

To make it easier to have a consistent build environment for subtrees and submodules that get included in `core`, we will now import the 2021 prelude into `core`.

Fixes rust-lang#122912

r? `@Nilstrieb`
rust-timer authored Mar 26, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents c98ea0d + d261647 commit a88b172
Showing 16 changed files with 7 additions and 23 deletions.
3 changes: 2 additions & 1 deletion library/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@ description = "The Rust Core Library"
autotests = false
autobenches = false
# If you update this, be sure to update it in a bunch of other places too!
# As of 2022, it was the ci/pgo.sh script and the core-no-fp-fmt-parse test.
# As of 2024, it was src/tools/opt-dist, the core-no-fp-fmt-parse test and
# the version of the prelude imported in core/lib.rs.
edition = "2021"

[lib]
1 change: 0 additions & 1 deletion library/core/src/array/equality.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::cmp::BytewiseEq;
use crate::convert::TryInto;

#[stable(feature = "rust1", since = "1.0.0")]
impl<T, U, const N: usize> PartialEq<[U; N]> for [T; N]
2 changes: 1 addition & 1 deletion library/core/src/array/mod.rs
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@

use crate::borrow::{Borrow, BorrowMut};
use crate::cmp::Ordering;
use crate::convert::{Infallible, TryFrom};
use crate::convert::Infallible;
use crate::error::Error;
use crate::fmt;
use crate::hash::{self, Hash};
1 change: 0 additions & 1 deletion library/core/src/char/convert.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Character conversions.
use crate::char::TryFromCharError;
use crate::convert::TryFrom;
use crate::error::Error;
use crate::fmt;
use crate::mem::transmute;
4 changes: 0 additions & 4 deletions library/core/src/convert/num.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use super::TryFrom;
use crate::num::TryFromIntError;

mod private {
@@ -323,7 +322,6 @@ impl_try_from_lower_bounded!(isize => usize);
#[cfg(target_pointer_width = "16")]
mod ptr_try_from_impls {
use super::TryFromIntError;
use crate::convert::TryFrom;

impl_try_from_upper_bounded!(usize => u8);
impl_try_from_unbounded!(usize => u16, u32, u64, u128);
@@ -346,7 +344,6 @@ mod ptr_try_from_impls {
#[cfg(target_pointer_width = "32")]
mod ptr_try_from_impls {
use super::TryFromIntError;
use crate::convert::TryFrom;

impl_try_from_upper_bounded!(usize => u8, u16);
impl_try_from_unbounded!(usize => u32, u64, u128);
@@ -372,7 +369,6 @@ mod ptr_try_from_impls {
#[cfg(target_pointer_width = "64")]
mod ptr_try_from_impls {
use super::TryFromIntError;
use crate::convert::TryFrom;

impl_try_from_upper_bounded!(usize => u8, u16, u32);
impl_try_from_unbounded!(usize => u64, u128);
1 change: 0 additions & 1 deletion library/core/src/iter/adapters/step_by.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::convert::TryFrom;
use crate::{
intrinsics,
iter::{from_fn, TrustedLen, TrustedRandomAccess},
1 change: 0 additions & 1 deletion library/core/src/iter/range.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use crate::ascii::Char as AsciiChar;
use crate::convert::TryFrom;
use crate::mem;
use crate::net::{Ipv4Addr, Ipv6Addr};
use crate::num::NonZero;
2 changes: 1 addition & 1 deletion library/core/src/iter/traits/iterator.rs
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@ use super::super::ByRefSized;
use super::super::TrustedRandomAccessNoCoerce;
use super::super::{ArrayChunks, Chain, Cloned, Copied, Cycle, Enumerate, Filter, FilterMap, Fuse};
use super::super::{FlatMap, Flatten};
use super::super::{FromIterator, Intersperse, IntersperseWith, Product, Sum, Zip};
use super::super::{
Inspect, Map, MapWhile, MapWindows, Peekable, Rev, Scan, Skip, SkipWhile, StepBy, Take,
TakeWhile,
};
use super::super::{Intersperse, IntersperseWith, Product, Sum, Zip};

fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {}

2 changes: 1 addition & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -285,7 +285,7 @@ extern crate self as core;

#[prelude_import]
#[allow(unused)]
use prelude::v1::*;
use prelude::rust_2021::*;

#[cfg(not(test))] // See #65860
#[macro_use]
1 change: 0 additions & 1 deletion library/core/src/net/parser.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
//! This module is "publicly exported" through the `FromStr` implementations
//! below.
use crate::convert::{TryFrom, TryInto};
use crate::error::Error;
use crate::fmt;
use crate::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6};
2 changes: 1 addition & 1 deletion library/core/src/option.rs
Original file line number Diff line number Diff line change
@@ -553,7 +553,7 @@
#![stable(feature = "rust1", since = "1.0.0")]

use crate::iter::{self, FromIterator, FusedIterator, TrustedLen};
use crate::iter::{self, FusedIterator, TrustedLen};
use crate::panicking::{panic, panic_str};
use crate::pin::Pin;
use crate::{
1 change: 0 additions & 1 deletion library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::convert::{TryFrom, TryInto};
use crate::num::NonZero;
#[cfg(debug_assertions)]
use crate::ub_checks::assert_unsafe_precondition;
2 changes: 1 addition & 1 deletion library/core/src/result.rs
Original file line number Diff line number Diff line change
@@ -488,7 +488,7 @@
#![stable(feature = "rust1", since = "1.0.0")]

use crate::iter::{self, FromIterator, FusedIterator, TrustedLen};
use crate::iter::{self, FusedIterator, TrustedLen};
use crate::ops::{self, ControlFlow, Deref, DerefMut};
use crate::{convert, fmt, hint};

2 changes: 0 additions & 2 deletions library/core/src/unit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use crate::iter::FromIterator;

/// Collapses all unit items from an iterator into one.
///
/// This is more useful when combined with higher-level abstractions, like
4 changes: 0 additions & 4 deletions library/portable-simd/crates/core_simd/src/lib.rs
Original file line number Diff line number Diff line change
@@ -45,10 +45,6 @@
#![unstable(feature = "portable_simd", issue = "86656")]
//! Portable SIMD module.
#[prelude_import]
#[allow(unused_imports)]
use core::prelude::v1::*;

#[path = "mod.rs"]
mod core_simd;
pub use self::core_simd::simd;
1 change: 0 additions & 1 deletion library/portable-simd/crates/core_simd/src/vector.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ use crate::simd::{
ptr::{SimdConstPtr, SimdMutPtr},
LaneCount, Mask, MaskElement, SupportedLaneCount, Swizzle,
};
use core::convert::{TryFrom, TryInto};

/// A SIMD vector with the shape of `[T; N]` but the operations of `T`.
///

0 comments on commit a88b172

Please sign in to comment.