Skip to content

Commit

Permalink
Auto merge of #82929 - m-ou-se:rollup-7fwrewh, r=m-ou-se
Browse files Browse the repository at this point in the history
Rollup of 8 pull requests

Successful merges:

 - #81127 (Improve sift_down performance in BinaryHeap)
 - #81879 (Added #[repr(transparent)] to core::cmp::Reverse)
 - #82048 (or-patterns: disallow in `let` bindings)
 - #82731 (Bump libc dependency of std to 0.2.88.)
 - #82799 (Add regression test for #75525)
 - #82841 (Change x64 size checks to not apply to x32.)
 - #82883 (Update Cargo)
 - #82887 (Update CONTRIBUTING.md)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Mar 9, 2021
2 parents 4b9f5cc + 74de9db commit 3a5d45f
Show file tree
Hide file tree
Showing 67 changed files with 753 additions and 411 deletions.
30 changes: 28 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,31 @@
# Contributing to Rust

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

To get started, read the [Contributing to Rust] chapter of the [rustc-dev-guide].
Documentation for contributing to Rust is located in the [Guide to Rustc Development](https://rustc-dev-guide.rust-lang.org/),
commonly known as the [rustc-dev-guide]. Despite the name, this guide documents
not just how to develop rustc (the Rust compiler), but also how to contribute to any part
of the Rust project.

To get started with contributing, please read the [Contributing to Rust] chapter of the guide.
That chapter explains how to get your development environment set up and how to get help.

## About the [rustc-dev-guide]

The [rustc-dev-guide] is meant to help document how rustc –the Rust compiler– works,
as well as to help new contributors get involved in rustc development. It is recommend
to read and understand the [rustc-dev-guide] before making a contribution. This guide
talks about the different bots in the Rust ecosystem, the Rust development tools,
bootstrapping, the compiler architecture, source code representation, and more.

## [Getting help](https://rustc-dev-guide.rust-lang.org/getting-started.html#asking-questions)

There are many ways you can get help when you're stuck. Rust has many platforms for this:
[internals], [rust-zulip], and [rust-discord]. It is recommended to ask for help on
the [rust-zulip], but any of these platforms are a great way to seek help and even
find a mentor! You can learn more about asking questions and getting help in the
[Asking Questions](https://rustc-dev-guide.rust-lang.org/getting-started.html#asking-questions) chapter of the [rustc-dev-guide].

## Bug reports

Expand All @@ -13,3 +36,6 @@ refer to [this section][contributing-bug-reports] and [open an issue][issue temp
[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/
[contributing-bug-reports]: https://rustc-dev-guide.rust-lang.org/contributing.html#bug-reports
[issue template]: https://github.com/rust-lang/rust/issues/new/choose
[internals]: https://internals.rust-lang.org
[rust-discord]: http://discord.gg/rust-lang
[rust-zulip]: https://rust-lang.zulipchat.com
85 changes: 63 additions & 22 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ version = "0.0.0"
dependencies = [
"compiler_builtins",
"core",
"rand",
"rand 0.7.3",
"rand_xorshift",
]

Expand Down Expand Up @@ -325,6 +325,7 @@ dependencies = [
"openssl",
"percent-encoding 2.1.0",
"pretty_env_logger",
"rand 0.8.3",
"rustc-workspace-hack",
"rustfix",
"same-file",
Expand Down Expand Up @@ -757,7 +758,7 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
name = "core"
version = "0.0.0"
dependencies = [
"rand",
"rand 0.7.3",
]

[[package]]
Expand Down Expand Up @@ -1662,7 +1663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ca8957e71f04a205cb162508f9326aea04676c8dfd0711220190d6b83664f3f"
dependencies = [
"bitmaps",
"rand_core",
"rand_core 0.5.1",
"rand_xoshiro",
"sized-chunks",
"typenum",
Expand Down Expand Up @@ -1867,7 +1868,7 @@ dependencies = [
"lazy_static",
"log",
"parking_lot",
"rand",
"rand 0.7.3",
"serde",
]

Expand Down Expand Up @@ -1912,9 +1913,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"

[[package]]
name = "libc"
version = "0.2.85"
version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a"
dependencies = [
"rustc-std-workspace-core",
]
Expand Down Expand Up @@ -2308,7 +2309,7 @@ dependencies = [
"hex 0.4.2",
"libc",
"log",
"rand",
"rand 0.7.3",
"rustc-workspace-hack",
"rustc_version",
"shell-escape",
Expand Down Expand Up @@ -2508,7 +2509,7 @@ dependencies = [
"log",
"mio-named-pipes",
"miow 0.3.6",
"rand",
"rand 0.7.3",
"tokio",
"winapi 0.3.9",
]
Expand Down Expand Up @@ -2645,7 +2646,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526"
dependencies = [
"phf_shared",
"rand",
"rand 0.7.3",
]

[[package]]
Expand Down Expand Up @@ -2892,20 +2893,42 @@ checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
dependencies = [
"getrandom 0.1.14",
"libc",
"rand_chacha",
"rand_core",
"rand_hc",
"rand_chacha 0.2.2",
"rand_core 0.5.1",
"rand_hc 0.2.0",
"rand_pcg",
]

[[package]]
name = "rand"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
dependencies = [
"libc",
"rand_chacha 0.3.0",
"rand_core 0.6.2",
"rand_hc 0.3.0",
]

[[package]]
name = "rand_chacha"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
dependencies = [
"ppv-lite86",
"rand_core",
"rand_core 0.5.1",
]

[[package]]
name = "rand_chacha"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
dependencies = [
"ppv-lite86",
"rand_core 0.6.2",
]

[[package]]
Expand All @@ -2917,13 +2940,31 @@ dependencies = [
"getrandom 0.1.14",
]

[[package]]
name = "rand_core"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
dependencies = [
"getrandom 0.2.0",
]

[[package]]
name = "rand_hc"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [
"rand_core",
"rand_core 0.5.1",
]

[[package]]
name = "rand_hc"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
dependencies = [
"rand_core 0.6.2",
]

[[package]]
Expand All @@ -2932,7 +2973,7 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
dependencies = [
"rand_core",
"rand_core 0.5.1",
]

[[package]]
Expand All @@ -2941,7 +2982,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
dependencies = [
"rand_core",
"rand_core 0.5.1",
]

[[package]]
Expand All @@ -2950,7 +2991,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
dependencies = [
"rand_core",
"rand_core 0.5.1",
]

[[package]]
Expand Down Expand Up @@ -3082,7 +3123,7 @@ dependencies = [
"num_cpus",
"ordslice",
"racer",
"rand",
"rand 0.7.3",
"rayon",
"regex",
"rls-analysis",
Expand Down Expand Up @@ -3153,7 +3194,7 @@ dependencies = [
"env_logger 0.7.1",
"futures 0.3.12",
"log",
"rand",
"rand 0.7.3",
"rls-data",
"rls-ipc",
"serde",
Expand Down Expand Up @@ -3933,7 +3974,7 @@ dependencies = [
name = "rustc_incremental"
version = "0.0.0"
dependencies = [
"rand",
"rand 0.7.3",
"rustc_ast",
"rustc_data_structures",
"rustc_fs_util",
Expand Down Expand Up @@ -4975,7 +5016,7 @@ dependencies = [
"panic_abort",
"panic_unwind",
"profiler_builtins",
"rand",
"rand 0.7.3",
"rustc-demangle",
"unwind",
"wasi",
Expand Down Expand Up @@ -5106,7 +5147,7 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9"
dependencies = [
"cfg-if 0.1.10",
"libc",
"rand",
"rand 0.7.3",
"redox_syscall 0.1.57",
"remove_dir_all",
"winapi 0.3.9",
Expand Down
8 changes: 4 additions & 4 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ pub struct Expr {
}

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

impl Expr {
Expand Down Expand Up @@ -2755,7 +2755,7 @@ pub enum ItemKind {
MacroDef(MacroDef),
}

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

impl ItemKind {
Expand Down Expand Up @@ -2829,7 +2829,7 @@ pub enum AssocItemKind {
MacCall(MacCall),
}

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

impl AssocItemKind {
Expand Down Expand Up @@ -2881,7 +2881,7 @@ pub enum ForeignItemKind {
MacCall(MacCall),
}

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

impl From<ForeignItemKind> for ItemKind {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub enum TokenKind {
}

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

#[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
Expand Down Expand Up @@ -682,7 +682,7 @@ pub enum Nonterminal {
}

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

#[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub struct TokenStream(pub(crate) Lrc<Vec<TreeAndSpacing>>);
pub type TreeAndSpacing = (TokenTree, Spacing);

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

#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;

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

#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Encodable, Decodable)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,7 @@ impl<'hir> Node<'hir> {
}

// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
mod size_asserts {
rustc_data_structures::static_assert_size!(super::Block<'static>, 48);
rustc_data_structures::static_assert_size!(super::Expr<'static>, 72);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub enum SubregionOrigin<'tcx> {
}

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

/// Times when we replace late-bound regions with variables:
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#[macro_use]
extern crate rustc_macros;
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;

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

pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/unused.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ impl EarlyLintPass for UnusedParens {

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

<Self as UnusedDelimLint>::check_stmt(self, cx, s)
Expand Down
Loading

0 comments on commit 3a5d45f

Please sign in to comment.