about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-04-06 12:42:01 +0000
committerbors <bors@rust-lang.org>2023-04-06 12:42:01 +0000
commit0534655d9b5f61dbd75cf142ec8d2d3f68b550ee (patch)
treea61668d9e1ae870e8da030abd2412c3ecf913e95 /compiler/rustc_interface/src
parentce3cb03927f711f653ae2937c10ba40a5ede62c7 (diff)
parent1dde34b831089a7acbb14e47810b356bbe951301 (diff)
downloadrust-0534655d9b5f61dbd75cf142ec8d2d3f68b550ee.tar.gz
rust-0534655d9b5f61dbd75cf142ec8d2d3f68b550ee.zip
Auto merge of #108504 - cjgillot:thir-pattern, r=compiler-errors,Nilstrieb
Check pattern refutability on THIR

The current `check_match` query is based on HIR, but partially re-lowers HIR into THIR.
This PR proposed to use the results of the `thir_body` query to check matches, instead of re-building THIR.

Most of the diagnostic changes are spans getting shorter, or commas/semicolons not getting removed.

This PR degrades the diagnostic for confusing constants in patterns (`let A = foo()` where `A` resolves to a `const A` somewhere): it does not point ot the definition of `const A` any more.
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 413b40ab808..8d4892470ac 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -765,7 +765,7 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
         parallel!(
             {
                 sess.time("match_checking", || {
-                    tcx.hir().par_body_owners(|def_id| tcx.ensure().check_match(def_id.to_def_id()))
+                    tcx.hir().par_body_owners(|def_id| tcx.ensure().check_match(def_id))
                 });
             },
             {