Skip to content

Commit

Permalink
Auto merge of rust-lang#122256 - Nadrieril:rollup-rc232xh, r=Nadrieril
Browse files Browse the repository at this point in the history
Rollup of 8 pull requests

Successful merges:

 - rust-lang#99153 (Add Read Impl for &Stdin)
 - rust-lang#114655 (Make `impl<Fd: AsFd>` impl take `?Sized`)
 - rust-lang#120504 (Vec::try_with_capacity)
 - rust-lang#121280 (Implement MaybeUninit::fill{,_with,_from})
 - rust-lang#121403 (impl From<TryReserveError> for io::Error)
 - rust-lang#121526 (on the fly type casting for `build.rustc` and `build.cargo`)
 - rust-lang#121584 (bump itertools to 0.12)
 - rust-lang#121711 (Implement junction_point)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Mar 9, 2024
2 parents 25ee3c6 + 13ca978 commit 2d24fe5
Show file tree
Hide file tree
Showing 48 changed files with 773 additions and 198 deletions.
36 changes: 13 additions & 23 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,6 @@ dependencies = [
"windows-sys 0.52.0",
]

[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"

[[package]]
name = "core"
version = "0.0.0"
Expand Down Expand Up @@ -1035,10 +1029,8 @@ version = "0.99.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
"proc-macro2",
"quote",
"rustc_version",
"syn 1.0.109",
]

Expand Down Expand Up @@ -3497,7 +3489,7 @@ dependencies = [
name = "rustc_ast_passes"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr",
Expand All @@ -3517,7 +3509,7 @@ dependencies = [
name = "rustc_ast_pretty"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_ast",
"rustc_lexer",
"rustc_span",
Expand Down Expand Up @@ -3558,7 +3550,7 @@ name = "rustc_borrowck"
version = "0.0.0"
dependencies = [
"either",
"itertools 0.11.0",
"itertools 0.12.1",
"polonius-engine",
"rustc_data_structures",
"rustc_errors",
Expand Down Expand Up @@ -3611,7 +3603,7 @@ name = "rustc_codegen_llvm"
version = "0.0.0"
dependencies = [
"bitflags 2.4.2",
"itertools 0.11.0",
"itertools 0.12.1",
"libc",
"measureme",
"object",
Expand Down Expand Up @@ -3647,7 +3639,7 @@ dependencies = [
"ar_archive_writer",
"bitflags 2.4.2",
"cc",
"itertools 0.11.0",
"itertools 0.12.1",
"jobserver",
"libc",
"object",
Expand Down Expand Up @@ -3929,7 +3921,7 @@ dependencies = [
name = "rustc_hir_analysis"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_arena",
"rustc_ast",
"rustc_attr",
Expand Down Expand Up @@ -3968,7 +3960,7 @@ dependencies = [
name = "rustc_hir_typeck"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_ast",
"rustc_ast_ir",
"rustc_attr",
Expand Down Expand Up @@ -4216,7 +4208,6 @@ name = "rustc_middle"
version = "0.0.0"
dependencies = [
"bitflags 2.4.2",
"derive_more",
"either",
"field-offset",
"gsgdt",
Expand Down Expand Up @@ -4254,7 +4245,7 @@ name = "rustc_mir_build"
version = "0.0.0"
dependencies = [
"either",
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_apfloat",
"rustc_arena",
"rustc_ast",
Expand Down Expand Up @@ -4301,7 +4292,7 @@ name = "rustc_mir_transform"
version = "0.0.0"
dependencies = [
"either",
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_arena",
"rustc_ast",
"rustc_attr",
Expand Down Expand Up @@ -4381,7 +4372,6 @@ dependencies = [
name = "rustc_passes"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr",
Expand Down Expand Up @@ -4632,7 +4622,7 @@ name = "rustc_trait_selection"
version = "0.0.0"
dependencies = [
"bitflags 2.4.2",
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_ast",
"rustc_ast_ir",
"rustc_attr",
Expand Down Expand Up @@ -4672,7 +4662,7 @@ dependencies = [
name = "rustc_transmute"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_ast_ir",
"rustc_data_structures",
"rustc_hir",
Expand All @@ -4688,7 +4678,7 @@ dependencies = [
name = "rustc_ty_utils"
version = "0.0.0"
dependencies = [
"itertools 0.11.0",
"itertools 0.12.1",
"rustc_ast_ir",
"rustc_data_structures",
"rustc_errors",
Expand Down Expand Up @@ -4738,7 +4728,7 @@ dependencies = [
"askama",
"expect-test",
"indexmap",
"itertools 0.11.0",
"itertools 0.12.1",
"minifier",
"once_cell",
"regex",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
# tidy-alphabetical-start
itertools = "0.11"
itertools = "0.12"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast_pretty/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
# tidy-alphabetical-start
itertools = "0.11"
itertools = "0.12"
rustc_ast = { path = "../rustc_ast" }
rustc_lexer = { path = "../rustc_lexer" }
rustc_span = { path = "../rustc_span" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
# tidy-alphabetical-start
either = "1.5.0"
itertools = "0.11"
itertools = "0.12"
polonius-engine = "0.13.0"
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test = false
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
itertools = "0.11"
itertools = "0.12"
libc = "0.2"
measureme = "11"
object = { version = "0.32.0", default-features = false, features = ["std", "read"] }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
ar_archive_writer = "0.1.5"
bitflags = "2.4.1"
cc = "1.0.90"
itertools = "0.11"
itertools = "0.12"
jobserver = "0.1.28"
pathdiff = "0.2.0"
regex = "1.4"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_analysis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doctest = false

[dependencies]
# tidy-alphabetical-start
itertools = "0.11"
itertools = "0.12"
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir_typeck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
# tidy-alphabetical-start
itertools = "0.11"
itertools = "0.12"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_middle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2021"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
derive_more = "0.99.17"
either = "1.5.0"
field-offset = "0.3.5"
gsgdt = "0.1.2"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
# tidy-alphabetical-start
either = "1"
itertools = "0.11"
itertools = "0.12"
rustc_apfloat = "0.2.0"
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
# tidy-alphabetical-start
either = "1"
itertools = "0.11"
itertools = "0.12"
rustc_arena = { path = "../rustc_arena" }
rustc_ast = { path = "../rustc_ast" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_passes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ edition = "2021"

[dependencies]
# tidy-alphabetical-start
itertools = "0.11"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
itertools = "0.11.0"
itertools = "0.12"
rustc_ast = { path = "../rustc_ast" }
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_transmute/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ rustc = [

[dev-dependencies]
# tidy-alphabetical-start
itertools = "0.11"
itertools = "0.12"
# tidy-alphabetical-end
2 changes: 1 addition & 1 deletion compiler/rustc_ty_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
# tidy-alphabetical-start
itertools = "0.11"
itertools = "0.12"
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
rustc_errors = { path = "../rustc_errors" }
Expand Down
24 changes: 24 additions & 0 deletions library/alloc/src/collections/vec_deque/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,30 @@ impl<T> VecDeque<T> {
pub fn with_capacity(capacity: usize) -> VecDeque<T> {
Self::with_capacity_in(capacity, Global)
}

/// Creates an empty deque with space for at least `capacity` elements.
///
/// # Errors
///
/// Returns an error if the capacity exceeds `isize::MAX` _bytes_,
/// or if the allocator reports allocation failure.
///
/// # Examples
///
/// ```
/// # #![feature(try_with_capacity)]
/// # #[allow(unused)]
/// # fn example() -> Result<(), std::collections::TryReserveError> {
/// use std::collections::VecDeque;
///
/// let deque: VecDeque<u32> = VecDeque::try_with_capacity(10)?;
/// # Ok(()) }
/// ```
#[inline]
#[unstable(feature = "try_with_capacity", issue = "91913")]
pub fn try_with_capacity(capacity: usize) -> Result<VecDeque<T>, TryReserveError> {
Ok(VecDeque { head: 0, len: 0, buf: RawVec::try_with_capacity_in(capacity, Global)? })
}
}

impl<T, A: Allocator> VecDeque<T, A> {
Expand Down
1 change: 1 addition & 0 deletions library/alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
#![feature(trusted_len)]
#![feature(trusted_random_access)]
#![feature(try_trait_v2)]
#![feature(try_with_capacity)]
#![feature(tuple_trait)]
#![feature(unchecked_math)]
#![feature(unicode_internals)]
Expand Down
Loading

0 comments on commit 2d24fe5

Please sign in to comment.