Skip to content

Commit 3a5d45f

Browse files
committed
Auto merge of rust-lang#82929 - m-ou-se:rollup-7fwrewh, r=m-ou-se
Rollup of 8 pull requests Successful merges: - rust-lang#81127 (Improve sift_down performance in BinaryHeap) - rust-lang#81879 (Added #[repr(transparent)] to core::cmp::Reverse) - rust-lang#82048 (or-patterns: disallow in `let` bindings) - rust-lang#82731 (Bump libc dependency of std to 0.2.88.) - rust-lang#82799 (Add regression test for rust-lang#75525) - rust-lang#82841 (Change x64 size checks to not apply to x32.) - rust-lang#82883 (Update Cargo) - rust-lang#82887 (Update CONTRIBUTING.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4b9f5cc + 74de9db commit 3a5d45f

File tree

67 files changed

+753
-411
lines changed

Some content is hidden

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

67 files changed

+753
-411
lines changed

CONTRIBUTING.md

+28-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,31 @@
11
# Contributing to Rust
22

3-
Thank you for your interest in contributing to Rust!
3+
Thank you for your interest in contributing to Rust! There are many ways to contribute
4+
and we appreciate all of them.
45

5-
To get started, read the [Contributing to Rust] chapter of the [rustc-dev-guide].
6+
Documentation for contributing to Rust is located in the [Guide to Rustc Development](https://rustc-dev-guide.rust-lang.org/),
7+
commonly known as the [rustc-dev-guide]. Despite the name, this guide documents
8+
not just how to develop rustc (the Rust compiler), but also how to contribute to any part
9+
of the Rust project.
10+
11+
To get started with contributing, please read the [Contributing to Rust] chapter of the guide.
12+
That chapter explains how to get your development environment set up and how to get help.
13+
14+
## About the [rustc-dev-guide]
15+
16+
The [rustc-dev-guide] is meant to help document how rustc –the Rust compiler– works,
17+
as well as to help new contributors get involved in rustc development. It is recommend
18+
to read and understand the [rustc-dev-guide] before making a contribution. This guide
19+
talks about the different bots in the Rust ecosystem, the Rust development tools,
20+
bootstrapping, the compiler architecture, source code representation, and more.
21+
22+
## [Getting help](https://rustc-dev-guide.rust-lang.org/getting-started.html#asking-questions)
23+
24+
There are many ways you can get help when you're stuck. Rust has many platforms for this:
25+
[internals], [rust-zulip], and [rust-discord]. It is recommended to ask for help on
26+
the [rust-zulip], but any of these platforms are a great way to seek help and even
27+
find a mentor! You can learn more about asking questions and getting help in the
28+
[Asking Questions](https://rustc-dev-guide.rust-lang.org/getting-started.html#asking-questions) chapter of the [rustc-dev-guide].
629

730
## Bug reports
831

@@ -13,3 +36,6 @@ refer to [this section][contributing-bug-reports] and [open an issue][issue temp
1336
[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/
1437
[contributing-bug-reports]: https://rustc-dev-guide.rust-lang.org/contributing.html#bug-reports
1538
[issue template]: https://github.com/rust-lang/rust/issues/new/choose
39+
[internals]: https://internals.rust-lang.org
40+
[rust-discord]: http://discord.gg/rust-lang
41+
[rust-zulip]: https://rust-lang.zulipchat.com

Cargo.lock

+63-22
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ version = "0.0.0"
3737
dependencies = [
3838
"compiler_builtins",
3939
"core",
40-
"rand",
40+
"rand 0.7.3",
4141
"rand_xorshift",
4242
]
4343

@@ -325,6 +325,7 @@ dependencies = [
325325
"openssl",
326326
"percent-encoding 2.1.0",
327327
"pretty_env_logger",
328+
"rand 0.8.3",
328329
"rustc-workspace-hack",
329330
"rustfix",
330331
"same-file",
@@ -757,7 +758,7 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
757758
name = "core"
758759
version = "0.0.0"
759760
dependencies = [
760-
"rand",
761+
"rand 0.7.3",
761762
]
762763

763764
[[package]]
@@ -1662,7 +1663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
16621663
checksum = "3ca8957e71f04a205cb162508f9326aea04676c8dfd0711220190d6b83664f3f"
16631664
dependencies = [
16641665
"bitmaps",
1665-
"rand_core",
1666+
"rand_core 0.5.1",
16661667
"rand_xoshiro",
16671668
"sized-chunks",
16681669
"typenum",
@@ -1867,7 +1868,7 @@ dependencies = [
18671868
"lazy_static",
18681869
"log",
18691870
"parking_lot",
1870-
"rand",
1871+
"rand 0.7.3",
18711872
"serde",
18721873
]
18731874

@@ -1912,9 +1913,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
19121913

19131914
[[package]]
19141915
name = "libc"
1915-
version = "0.2.85"
1916+
version = "0.2.88"
19161917
source = "registry+https://github.com/rust-lang/crates.io-index"
1917-
checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
1918+
checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a"
19181919
dependencies = [
19191920
"rustc-std-workspace-core",
19201921
]
@@ -2308,7 +2309,7 @@ dependencies = [
23082309
"hex 0.4.2",
23092310
"libc",
23102311
"log",
2311-
"rand",
2312+
"rand 0.7.3",
23122313
"rustc-workspace-hack",
23132314
"rustc_version",
23142315
"shell-escape",
@@ -2508,7 +2509,7 @@ dependencies = [
25082509
"log",
25092510
"mio-named-pipes",
25102511
"miow 0.3.6",
2511-
"rand",
2512+
"rand 0.7.3",
25122513
"tokio",
25132514
"winapi 0.3.9",
25142515
]
@@ -2645,7 +2646,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
26452646
checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526"
26462647
dependencies = [
26472648
"phf_shared",
2648-
"rand",
2649+
"rand 0.7.3",
26492650
]
26502651

26512652
[[package]]
@@ -2892,20 +2893,42 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
28922893
dependencies = [
28932894
"getrandom 0.1.14",
28942895
"libc",
2895-
"rand_chacha",
2896-
"rand_core",
2897-
"rand_hc",
2896+
"rand_chacha 0.2.2",
2897+
"rand_core 0.5.1",
2898+
"rand_hc 0.2.0",
28982899
"rand_pcg",
28992900
]
29002901

2902+
[[package]]
2903+
name = "rand"
2904+
version = "0.8.3"
2905+
source = "registry+https://github.com/rust-lang/crates.io-index"
2906+
checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
2907+
dependencies = [
2908+
"libc",
2909+
"rand_chacha 0.3.0",
2910+
"rand_core 0.6.2",
2911+
"rand_hc 0.3.0",
2912+
]
2913+
29012914
[[package]]
29022915
name = "rand_chacha"
29032916
version = "0.2.2"
29042917
source = "registry+https://github.com/rust-lang/crates.io-index"
29052918
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
29062919
dependencies = [
29072920
"ppv-lite86",
2908-
"rand_core",
2921+
"rand_core 0.5.1",
2922+
]
2923+
2924+
[[package]]
2925+
name = "rand_chacha"
2926+
version = "0.3.0"
2927+
source = "registry+https://github.com/rust-lang/crates.io-index"
2928+
checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
2929+
dependencies = [
2930+
"ppv-lite86",
2931+
"rand_core 0.6.2",
29092932
]
29102933

29112934
[[package]]
@@ -2917,13 +2940,31 @@ dependencies = [
29172940
"getrandom 0.1.14",
29182941
]
29192942

2943+
[[package]]
2944+
name = "rand_core"
2945+
version = "0.6.2"
2946+
source = "registry+https://github.com/rust-lang/crates.io-index"
2947+
checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
2948+
dependencies = [
2949+
"getrandom 0.2.0",
2950+
]
2951+
29202952
[[package]]
29212953
name = "rand_hc"
29222954
version = "0.2.0"
29232955
source = "registry+https://github.com/rust-lang/crates.io-index"
29242956
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
29252957
dependencies = [
2926-
"rand_core",
2958+
"rand_core 0.5.1",
2959+
]
2960+
2961+
[[package]]
2962+
name = "rand_hc"
2963+
version = "0.3.0"
2964+
source = "registry+https://github.com/rust-lang/crates.io-index"
2965+
checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
2966+
dependencies = [
2967+
"rand_core 0.6.2",
29272968
]
29282969

29292970
[[package]]
@@ -2932,7 +2973,7 @@ version = "0.2.1"
29322973
source = "registry+https://github.com/rust-lang/crates.io-index"
29332974
checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
29342975
dependencies = [
2935-
"rand_core",
2976+
"rand_core 0.5.1",
29362977
]
29372978

29382979
[[package]]
@@ -2941,7 +2982,7 @@ version = "0.2.0"
29412982
source = "registry+https://github.com/rust-lang/crates.io-index"
29422983
checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
29432984
dependencies = [
2944-
"rand_core",
2985+
"rand_core 0.5.1",
29452986
]
29462987

29472988
[[package]]
@@ -2950,7 +2991,7 @@ version = "0.4.0"
29502991
source = "registry+https://github.com/rust-lang/crates.io-index"
29512992
checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
29522993
dependencies = [
2953-
"rand_core",
2994+
"rand_core 0.5.1",
29542995
]
29552996

29562997
[[package]]
@@ -3082,7 +3123,7 @@ dependencies = [
30823123
"num_cpus",
30833124
"ordslice",
30843125
"racer",
3085-
"rand",
3126+
"rand 0.7.3",
30863127
"rayon",
30873128
"regex",
30883129
"rls-analysis",
@@ -3153,7 +3194,7 @@ dependencies = [
31533194
"env_logger 0.7.1",
31543195
"futures 0.3.12",
31553196
"log",
3156-
"rand",
3197+
"rand 0.7.3",
31573198
"rls-data",
31583199
"rls-ipc",
31593200
"serde",
@@ -3933,7 +3974,7 @@ dependencies = [
39333974
name = "rustc_incremental"
39343975
version = "0.0.0"
39353976
dependencies = [
3936-
"rand",
3977+
"rand 0.7.3",
39373978
"rustc_ast",
39383979
"rustc_data_structures",
39393980
"rustc_fs_util",
@@ -4975,7 +5016,7 @@ dependencies = [
49755016
"panic_abort",
49765017
"panic_unwind",
49775018
"profiler_builtins",
4978-
"rand",
5019+
"rand 0.7.3",
49795020
"rustc-demangle",
49805021
"unwind",
49815022
"wasi",
@@ -5106,7 +5147,7 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
51065147
dependencies = [
51075148
"cfg-if 0.1.10",
51085149
"libc",
5109-
"rand",
5150+
"rand 0.7.3",
51105151
"redox_syscall 0.1.57",
51115152
"remove_dir_all",
51125153
"winapi 0.3.9",

compiler/rustc_ast/src/ast.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ pub struct Expr {
10731073
}
10741074

10751075
// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
1076-
#[cfg(target_arch = "x86_64")]
1076+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
10771077
rustc_data_structures::static_assert_size!(Expr, 120);
10781078

10791079
impl Expr {
@@ -2755,7 +2755,7 @@ pub enum ItemKind {
27552755
MacroDef(MacroDef),
27562756
}
27572757

2758-
#[cfg(target_arch = "x86_64")]
2758+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
27592759
rustc_data_structures::static_assert_size!(ItemKind, 112);
27602760

27612761
impl ItemKind {
@@ -2829,7 +2829,7 @@ pub enum AssocItemKind {
28292829
MacCall(MacCall),
28302830
}
28312831

2832-
#[cfg(target_arch = "x86_64")]
2832+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
28332833
rustc_data_structures::static_assert_size!(AssocItemKind, 72);
28342834

28352835
impl AssocItemKind {
@@ -2881,7 +2881,7 @@ pub enum ForeignItemKind {
28812881
MacCall(MacCall),
28822882
}
28832883

2884-
#[cfg(target_arch = "x86_64")]
2884+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
28852885
rustc_data_structures::static_assert_size!(ForeignItemKind, 72);
28862886

28872887
impl From<ForeignItemKind> for ItemKind {

compiler/rustc_ast/src/token.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ pub enum TokenKind {
244244
}
245245

246246
// `TokenKind` is used a lot. Make sure it doesn't unintentionally get bigger.
247-
#[cfg(target_arch = "x86_64")]
247+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
248248
rustc_data_structures::static_assert_size!(TokenKind, 16);
249249

250250
#[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
@@ -682,7 +682,7 @@ pub enum Nonterminal {
682682
}
683683

684684
// `Nonterminal` is used a lot. Make sure it doesn't unintentionally get bigger.
685-
#[cfg(target_arch = "x86_64")]
685+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
686686
rustc_data_structures::static_assert_size!(Nonterminal, 48);
687687

688688
#[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable)]

compiler/rustc_ast/src/tokenstream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ pub struct TokenStream(pub(crate) Lrc<Vec<TreeAndSpacing>>);
189189
pub type TreeAndSpacing = (TokenTree, Spacing);
190190

191191
// `TokenStream` is used a lot. Make sure it doesn't unintentionally get bigger.
192-
#[cfg(target_arch = "x86_64")]
192+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
193193
rustc_data_structures::static_assert_size!(TokenStream, 8);
194194

195195
#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable)]

compiler/rustc_errors/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;
5252

5353
// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
5454
// (See also the comment on `DiagnosticBuilderInner`.)
55-
#[cfg(target_arch = "x86_64")]
55+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
5656
rustc_data_structures::static_assert_size!(PResult<'_, bool>, 16);
5757

5858
#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Encodable, Decodable)]

compiler/rustc_hir/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3088,7 +3088,7 @@ impl<'hir> Node<'hir> {
30883088
}
30893089

30903090
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
3091-
#[cfg(target_arch = "x86_64")]
3091+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
30923092
mod size_asserts {
30933093
rustc_data_structures::static_assert_size!(super::Block<'static>, 48);
30943094
rustc_data_structures::static_assert_size!(super::Expr<'static>, 72);

compiler/rustc_infer/src/infer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ pub enum SubregionOrigin<'tcx> {
408408
}
409409

410410
// `SubregionOrigin` is used a lot. Make sure it doesn't unintentionally get bigger.
411-
#[cfg(target_arch = "x86_64")]
411+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
412412
static_assert_size!(SubregionOrigin<'_>, 32);
413413

414414
/// Times when we replace late-bound regions with variables:

compiler/rustc_infer/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#[macro_use]
2929
extern crate rustc_macros;
30-
#[cfg(target_arch = "x86_64")]
30+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
3131
#[macro_use]
3232
extern crate rustc_data_structures;
3333
#[macro_use]

compiler/rustc_infer/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
5656
pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;
5757

5858
// `PredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
59-
#[cfg(target_arch = "x86_64")]
59+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
6060
static_assert_size!(PredicateObligation<'_>, 32);
6161

6262
pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;

compiler/rustc_lint/src/unused.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ impl EarlyLintPass for UnusedParens {
872872

873873
fn check_stmt(&mut self, cx: &EarlyContext<'_>, s: &ast::Stmt) {
874874
if let StmtKind::Local(ref local) = s.kind {
875-
self.check_unused_parens_pat(cx, &local.pat, false, false);
875+
self.check_unused_parens_pat(cx, &local.pat, true, false);
876876
}
877877

878878
<Self as UnusedDelimLint>::check_stmt(self, cx, s)

0 commit comments

Comments
 (0)