From 7fc63a62eeef5dd6c81ba744fa7f4890c2b86b90 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 30 Apr 2023 14:08:26 +0000 Subject: [PATCH 1/3] Remove wrong assertion. --- .../rustc_mir_build/src/thir/pattern/check_match.rs | 3 --- tests/ui/match/guards-parenthesized-and.rs | 10 ++++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 tests/ui/match/guards-parenthesized-and.rs diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs index bac46db2b1e62..8f58db504f68f 100644 --- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs +++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs @@ -334,9 +334,6 @@ impl<'p, 'tcx> MatchVisitor<'_, 'p, 'tcx> { let refutable = !is_let_irrefutable(&mut ncx, local_lint_level, tpat); Some((expr.span, refutable)) } - ExprKind::LogicalOp { op: LogicalOp::And, .. } => { - bug!() - } _ => None, } }; diff --git a/tests/ui/match/guards-parenthesized-and.rs b/tests/ui/match/guards-parenthesized-and.rs new file mode 100644 index 0000000000000..3a1c341f3ee5a --- /dev/null +++ b/tests/ui/match/guards-parenthesized-and.rs @@ -0,0 +1,10 @@ +// check-pass + +fn main() { + let c = 1; + let w = "T"; + match Some(5) { + None if c == 1 && (w != "Y" && w != "E") => {} + _ => panic!(), + } +} From 428ac2a66ee3117f5e13dad315516e8715bc581a Mon Sep 17 00:00:00 2001 From: Be Wilson Date: Thu, 27 Apr 2023 14:33:36 -0500 Subject: [PATCH 2/3] only error with +whole-archive,+bundle for rlibs Fixes https://github.com/rust-lang/rust/issues/110912 Checking `flavor == RlibFlavor::Normal` was accidentally lost in 601fc8b36b1962285e371cf3c54eeb3b1b9b3a74 https://github.com/rust-lang/rust/pull/105601 That caused combining +whole-archive and +bundle link modifiers on non-rlib crates to fail with a confusing error message saying that combination is unstable for rlibs. In particular, this caused the build to fail when +whole-archive was used on staticlib crates, even though +whole-archive effectively does nothing on non-bin crates because the final linker invocation is left to an external build system. --- compiler/rustc_codegen_ssa/src/back/link.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 02e21e74fadc8..eecfe13bb3eef 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -349,7 +349,10 @@ fn link_rlib<'a>( let NativeLibKind::Static { bundle: None | Some(true), whole_archive } = lib.kind else { continue; }; - if whole_archive == Some(true) && !codegen_results.crate_info.feature_packed_bundled_libs { + if whole_archive == Some(true) + && flavor == RlibFlavor::Normal + && !codegen_results.crate_info.feature_packed_bundled_libs + { sess.emit_err(errors::IncompatibleLinkingModifiers); } if flavor == RlibFlavor::Normal && let Some(filename) = lib.filename { From c11cc105588ad2da8cf33a948ba5dee78fd95af6 Mon Sep 17 00:00:00 2001 From: Krasimir Georgiev Date: Thu, 4 May 2023 13:07:10 +0000 Subject: [PATCH 3/3] bootstrap: add .gitmodules to the sources The bootstrap builder now expects this file to exist: https://github.com/rust-lang/rust/blob/6f8c0557e0b73c73a8a7163a15f4a5a3feca7d5c/src/bootstrap/builder.rs#L494 --- src/bootstrap/dist.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 9498b772f58e0..76aad16c1fc26 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -976,6 +976,7 @@ impl Step for PlainSourceTarball { "config.example.toml", "Cargo.toml", "Cargo.lock", + ".gitmodules", ]; let src_dirs = ["src", "compiler", "library", "tests"];