Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4d76b4c

Browse files
committedMar 13, 2021
Auto merge of #83067 - JohnTitor:rollup-0wo338i, r=JohnTitor
Rollup of 6 pull requests Successful merges: - #82984 (Simplify ast block lowering) - #83012 (Update Clippy) - #83020 (Emit the enum range assumption if the range only contains one element) - #83037 (Support merge_functions option in NewPM since LLVM >= 12) - #83052 (updated vulnerable deps) - #83059 (Allow configuring `rustdoc --disable-minification` in config.toml) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 46a934a + 684fa19 commit 4d76b4c

File tree

305 files changed

+15670
-12498
lines changed

Some content is hidden

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

305 files changed

+15670
-12498
lines changed
 

‎Cargo.lock

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,6 @@ version = "1.0.34"
9595
source = "registry+https://github.com/rust-lang/crates.io-index"
9696
checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7"
9797

98-
[[package]]
99-
name = "arc-swap"
100-
version = "0.4.7"
101-
source = "registry+https://github.com/rust-lang/crates.io-index"
102-
checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
103-
10498
[[package]]
10599
name = "array_tool"
106100
version = "1.0.3"
@@ -177,7 +171,7 @@ dependencies = [
177171
"block-padding",
178172
"byte-tools",
179173
"byteorder",
180-
"generic-array 0.12.3",
174+
"generic-array 0.12.4",
181175
]
182176

183177
[[package]]
@@ -570,6 +564,7 @@ dependencies = [
570564
"clippy_lints",
571565
"compiletest_rs 0.6.0",
572566
"derive-new",
567+
"regex",
573568
"rustc-workspace-hack",
574569
"rustc_tools_util 0.2.0",
575570
"semver 0.11.0",
@@ -1006,7 +1001,7 @@ version = "0.8.1"
10061001
source = "registry+https://github.com/rust-lang/crates.io-index"
10071002
checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
10081003
dependencies = [
1009-
"generic-array 0.12.3",
1004+
"generic-array 0.12.4",
10101005
]
10111006

10121007
[[package]]
@@ -1399,9 +1394,9 @@ dependencies = [
13991394

14001395
[[package]]
14011396
name = "generic-array"
1402-
version = "0.12.3"
1397+
version = "0.12.4"
14031398
source = "registry+https://github.com/rust-lang/crates.io-index"
1404-
checksum = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
1399+
checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd"
14051400
dependencies = [
14061401
"typenum",
14071402
]
@@ -4917,11 +4912,10 @@ checksum = "42a568c8f2cd051a4d283bd6eb0343ac214c1b0f1ac19f93e1175b2dee38c73d"
49174912

49184913
[[package]]
49194914
name = "signal-hook-registry"
4920-
version = "1.2.1"
4915+
version = "1.2.2"
49214916
source = "registry+https://github.com/rust-lang/crates.io-index"
4922-
checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
4917+
checksum = "ce32ea0c6c56d5eacaeb814fbed9960547021d3edd010ded1425f180536b20ab"
49234918
dependencies = [
4924-
"arc-swap",
49254919
"libc",
49264920
]
49274921

@@ -4933,9 +4927,9 @@ checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7"
49334927

49344928
[[package]]
49354929
name = "sized-chunks"
4936-
version = "0.6.2"
4930+
version = "0.6.4"
49374931
source = "registry+https://github.com/rust-lang/crates.io-index"
4938-
checksum = "1ec31ceca5644fa6d444cc77548b88b67f46db6f7c71683b0f9336e671830d2f"
4932+
checksum = "65e65d6a9f13cd78f361ea5a2cf53a45d67cdda421ba0316b9be101560f3d207"
49394933
dependencies = [
49404934
"bitmaps",
49414935
"typenum",

‎compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,26 +2409,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
24092409
}
24102410

24112411
fn lower_block_noalloc(&mut self, b: &Block, targeted_by_break: bool) -> hir::Block<'hir> {
2412-
let mut expr: Option<&'hir _> = None;
2413-
2414-
let stmts = self.arena.alloc_from_iter(
2415-
b.stmts
2416-
.iter()
2417-
.enumerate()
2418-
.filter_map(|(index, stmt)| {
2419-
if index == b.stmts.len() - 1 {
2420-
if let StmtKind::Expr(ref e) = stmt.kind {
2421-
expr = Some(self.lower_expr(e));
2422-
None
2423-
} else {
2424-
Some(self.lower_stmt(stmt))
2425-
}
2426-
} else {
2427-
Some(self.lower_stmt(stmt))
2428-
}
2429-
})
2430-
.flatten(),
2431-
);
2412+
let (stmts, expr) = match &*b.stmts {
2413+
[stmts @ .., Stmt { kind: StmtKind::Expr(e), .. }] => (stmts, Some(&*e)),
2414+
stmts => (stmts, None),
2415+
};
2416+
let stmts = self.arena.alloc_from_iter(stmts.iter().flat_map(|stmt| self.lower_stmt(stmt)));
2417+
let expr = expr.map(|e| self.lower_expr(e));
24322418
let rules = self.lower_block_check_mode(&b.rules);
24332419
let hir_id = self.lower_node_id(b.id);
24342420

0 commit comments

Comments
 (0)
Please sign in to comment.