Skip to content

Commit 2d24fe5

Browse files
committed
Auto merge of rust-lang#122256 - Nadrieril:rollup-rc232xh, r=Nadrieril
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
2 parents 25ee3c6 + 13ca978 commit 2d24fe5

File tree

48 files changed

+773
-198
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+773
-198
lines changed

Cargo.lock

+13-23
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,6 @@ dependencies = [
784784
"windows-sys 0.52.0",
785785
]
786786

787-
[[package]]
788-
name = "convert_case"
789-
version = "0.4.0"
790-
source = "registry+https://github.com/rust-lang/crates.io-index"
791-
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
792-
793787
[[package]]
794788
name = "core"
795789
version = "0.0.0"
@@ -1035,10 +1029,8 @@ version = "0.99.17"
10351029
source = "registry+https://github.com/rust-lang/crates.io-index"
10361030
checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
10371031
dependencies = [
1038-
"convert_case",
10391032
"proc-macro2",
10401033
"quote",
1041-
"rustc_version",
10421034
"syn 1.0.109",
10431035
]
10441036

@@ -3497,7 +3489,7 @@ dependencies = [
34973489
name = "rustc_ast_passes"
34983490
version = "0.0.0"
34993491
dependencies = [
3500-
"itertools 0.11.0",
3492+
"itertools 0.12.1",
35013493
"rustc_ast",
35023494
"rustc_ast_pretty",
35033495
"rustc_attr",
@@ -3517,7 +3509,7 @@ dependencies = [
35173509
name = "rustc_ast_pretty"
35183510
version = "0.0.0"
35193511
dependencies = [
3520-
"itertools 0.11.0",
3512+
"itertools 0.12.1",
35213513
"rustc_ast",
35223514
"rustc_lexer",
35233515
"rustc_span",
@@ -3558,7 +3550,7 @@ name = "rustc_borrowck"
35583550
version = "0.0.0"
35593551
dependencies = [
35603552
"either",
3561-
"itertools 0.11.0",
3553+
"itertools 0.12.1",
35623554
"polonius-engine",
35633555
"rustc_data_structures",
35643556
"rustc_errors",
@@ -3611,7 +3603,7 @@ name = "rustc_codegen_llvm"
36113603
version = "0.0.0"
36123604
dependencies = [
36133605
"bitflags 2.4.2",
3614-
"itertools 0.11.0",
3606+
"itertools 0.12.1",
36153607
"libc",
36163608
"measureme",
36173609
"object",
@@ -3647,7 +3639,7 @@ dependencies = [
36473639
"ar_archive_writer",
36483640
"bitflags 2.4.2",
36493641
"cc",
3650-
"itertools 0.11.0",
3642+
"itertools 0.12.1",
36513643
"jobserver",
36523644
"libc",
36533645
"object",
@@ -3929,7 +3921,7 @@ dependencies = [
39293921
name = "rustc_hir_analysis"
39303922
version = "0.0.0"
39313923
dependencies = [
3932-
"itertools 0.11.0",
3924+
"itertools 0.12.1",
39333925
"rustc_arena",
39343926
"rustc_ast",
39353927
"rustc_attr",
@@ -3968,7 +3960,7 @@ dependencies = [
39683960
name = "rustc_hir_typeck"
39693961
version = "0.0.0"
39703962
dependencies = [
3971-
"itertools 0.11.0",
3963+
"itertools 0.12.1",
39723964
"rustc_ast",
39733965
"rustc_ast_ir",
39743966
"rustc_attr",
@@ -4216,7 +4208,6 @@ name = "rustc_middle"
42164208
version = "0.0.0"
42174209
dependencies = [
42184210
"bitflags 2.4.2",
4219-
"derive_more",
42204211
"either",
42214212
"field-offset",
42224213
"gsgdt",
@@ -4254,7 +4245,7 @@ name = "rustc_mir_build"
42544245
version = "0.0.0"
42554246
dependencies = [
42564247
"either",
4257-
"itertools 0.11.0",
4248+
"itertools 0.12.1",
42584249
"rustc_apfloat",
42594250
"rustc_arena",
42604251
"rustc_ast",
@@ -4301,7 +4292,7 @@ name = "rustc_mir_transform"
43014292
version = "0.0.0"
43024293
dependencies = [
43034294
"either",
4304-
"itertools 0.11.0",
4295+
"itertools 0.12.1",
43054296
"rustc_arena",
43064297
"rustc_ast",
43074298
"rustc_attr",
@@ -4381,7 +4372,6 @@ dependencies = [
43814372
name = "rustc_passes"
43824373
version = "0.0.0"
43834374
dependencies = [
4384-
"itertools 0.11.0",
43854375
"rustc_ast",
43864376
"rustc_ast_pretty",
43874377
"rustc_attr",
@@ -4632,7 +4622,7 @@ name = "rustc_trait_selection"
46324622
version = "0.0.0"
46334623
dependencies = [
46344624
"bitflags 2.4.2",
4635-
"itertools 0.11.0",
4625+
"itertools 0.12.1",
46364626
"rustc_ast",
46374627
"rustc_ast_ir",
46384628
"rustc_attr",
@@ -4672,7 +4662,7 @@ dependencies = [
46724662
name = "rustc_transmute"
46734663
version = "0.0.0"
46744664
dependencies = [
4675-
"itertools 0.11.0",
4665+
"itertools 0.12.1",
46764666
"rustc_ast_ir",
46774667
"rustc_data_structures",
46784668
"rustc_hir",
@@ -4688,7 +4678,7 @@ dependencies = [
46884678
name = "rustc_ty_utils"
46894679
version = "0.0.0"
46904680
dependencies = [
4691-
"itertools 0.11.0",
4681+
"itertools 0.12.1",
46924682
"rustc_ast_ir",
46934683
"rustc_data_structures",
46944684
"rustc_errors",
@@ -4738,7 +4728,7 @@ dependencies = [
47384728
"askama",
47394729
"expect-test",
47404730
"indexmap",
4741-
"itertools 0.11.0",
4731+
"itertools 0.12.1",
47424732
"minifier",
47434733
"once_cell",
47444734
"regex",

compiler/rustc_ast_passes/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
itertools = "0.11"
8+
itertools = "0.12"
99
rustc_ast = { path = "../rustc_ast" }
1010
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1111
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_ast_pretty/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
itertools = "0.11"
8+
itertools = "0.12"
99
rustc_ast = { path = "../rustc_ast" }
1010
rustc_lexer = { path = "../rustc_lexer" }
1111
rustc_span = { path = "../rustc_span" }

compiler/rustc_borrowck/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
either = "1.5.0"
9-
itertools = "0.11"
9+
itertools = "0.12"
1010
polonius-engine = "0.13.0"
1111
rustc_data_structures = { path = "../rustc_data_structures" }
1212
rustc_errors = { path = "../rustc_errors" }

compiler/rustc_codegen_llvm/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test = false
99
[dependencies]
1010
# tidy-alphabetical-start
1111
bitflags = "2.4.1"
12-
itertools = "0.11"
12+
itertools = "0.12"
1313
libc = "0.2"
1414
measureme = "11"
1515
object = { version = "0.32.0", default-features = false, features = ["std", "read"] }

compiler/rustc_codegen_ssa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
ar_archive_writer = "0.1.5"
99
bitflags = "2.4.1"
1010
cc = "1.0.90"
11-
itertools = "0.11"
11+
itertools = "0.12"
1212
jobserver = "0.1.28"
1313
pathdiff = "0.2.0"
1414
regex = "1.4"

compiler/rustc_hir_analysis/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ doctest = false
99

1010
[dependencies]
1111
# tidy-alphabetical-start
12-
itertools = "0.11"
12+
itertools = "0.12"
1313
rustc_arena = { path = "../rustc_arena" }
1414
rustc_ast = { path = "../rustc_ast" }
1515
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_hir_typeck/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
itertools = "0.11"
8+
itertools = "0.12"
99
rustc_ast = { path = "../rustc_ast" }
1010
rustc_ast_ir = { path = "../rustc_ast_ir" }
1111
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_middle/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
derive_more = "0.99.17"
109
either = "1.5.0"
1110
field-offset = "0.3.5"
1211
gsgdt = "0.1.2"

compiler/rustc_mir_build/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
either = "1"
9-
itertools = "0.11"
9+
itertools = "0.12"
1010
rustc_apfloat = "0.2.0"
1111
rustc_arena = { path = "../rustc_arena" }
1212
rustc_ast = { path = "../rustc_ast" }

compiler/rustc_mir_transform/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
either = "1"
9-
itertools = "0.11"
9+
itertools = "0.12"
1010
rustc_arena = { path = "../rustc_arena" }
1111
rustc_ast = { path = "../rustc_ast" }
1212
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_passes/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
itertools = "0.11"
98
rustc_ast = { path = "../rustc_ast" }
109
rustc_ast_pretty = { path = "../rustc_ast_pretty" }
1110
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_trait_selection/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
9-
itertools = "0.11.0"
9+
itertools = "0.12"
1010
rustc_ast = { path = "../rustc_ast" }
1111
rustc_ast_ir = { path = "../rustc_ast_ir" }
1212
rustc_attr = { path = "../rustc_attr" }

compiler/rustc_transmute/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ rustc = [
2929

3030
[dev-dependencies]
3131
# tidy-alphabetical-start
32-
itertools = "0.11"
32+
itertools = "0.12"
3333
# tidy-alphabetical-end

compiler/rustc_ty_utils/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
itertools = "0.11"
8+
itertools = "0.12"
99
rustc_ast_ir = { path = "../rustc_ast_ir" }
1010
rustc_data_structures = { path = "../rustc_data_structures" }
1111
rustc_errors = { path = "../rustc_errors" }

library/alloc/src/collections/vec_deque/mod.rs

+24
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,30 @@ impl<T> VecDeque<T> {
559559
pub fn with_capacity(capacity: usize) -> VecDeque<T> {
560560
Self::with_capacity_in(capacity, Global)
561561
}
562+
563+
/// Creates an empty deque with space for at least `capacity` elements.
564+
///
565+
/// # Errors
566+
///
567+
/// Returns an error if the capacity exceeds `isize::MAX` _bytes_,
568+
/// or if the allocator reports allocation failure.
569+
///
570+
/// # Examples
571+
///
572+
/// ```
573+
/// # #![feature(try_with_capacity)]
574+
/// # #[allow(unused)]
575+
/// # fn example() -> Result<(), std::collections::TryReserveError> {
576+
/// use std::collections::VecDeque;
577+
///
578+
/// let deque: VecDeque<u32> = VecDeque::try_with_capacity(10)?;
579+
/// # Ok(()) }
580+
/// ```
581+
#[inline]
582+
#[unstable(feature = "try_with_capacity", issue = "91913")]
583+
pub fn try_with_capacity(capacity: usize) -> Result<VecDeque<T>, TryReserveError> {
584+
Ok(VecDeque { head: 0, len: 0, buf: RawVec::try_with_capacity_in(capacity, Global)? })
585+
}
562586
}
563587

564588
impl<T, A: Allocator> VecDeque<T, A> {

library/alloc/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
#![feature(trusted_len)]
164164
#![feature(trusted_random_access)]
165165
#![feature(try_trait_v2)]
166+
#![feature(try_with_capacity)]
166167
#![feature(tuple_trait)]
167168
#![feature(unchecked_math)]
168169
#![feature(unicode_internals)]

0 commit comments

Comments
 (0)