summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-05-07 20:10:35 +0000
committerbors <bors@rust-lang.org>2023-05-07 20:10:35 +0000
commit2013813b65016b39d456a12e3b0a90366e9fb5e3 (patch)
tree6b153b64eccbb0078d93f2c44cd046a1e426b6cb
parentcc38d9fe09fc068e5b070b31f4bd2f211ca5c067 (diff)
parentc11cc105588ad2da8cf33a948ba5dee78fd95af6 (diff)
downloadrust-beta.tar.gz
Auto merge of #111290 - Mark-Simulacrum:beta-backport, r=Mark-Simulacrumbeta
[beta] backport This PR backports: - #111015: Remove wrong assertion in match checking. - #110917: only error combining +whole-archive and +bundle for rlibs - #111201: bootstrap: add .gitmodules to the sources r? `@Mark-Simulacrum`
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs5
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/check_match.rs3
-rw-r--r--src/bootstrap/dist.rs1
-rw-r--r--tests/ui/match/guards-parenthesized-and.rs10
4 files changed, 15 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 02e21e74fad..eecfe13bb3e 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 {
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 bac46db2b1e..8f58db504f6 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/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 9498b772f58..76aad16c1fc 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"];
diff --git a/tests/ui/match/guards-parenthesized-and.rs b/tests/ui/match/guards-parenthesized-and.rs
new file mode 100644
index 00000000000..3a1c341f3ee
--- /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!(),
+ }
+}