about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2024-07-18 05:14:05 -0500
committerGitHub <noreply@github.com>2024-07-18 05:14:05 -0500
commita2178dffc8bc4db7a13e4b93af0d9030a9c616d6 (patch)
treedf09113c49fc6cebc7e45b8c7ca1c58aa9ce3180 /src
parent78fe5f76bf3f1f9a7de57a3ecd611acb532fcaa3 (diff)
parent303a2db2360e332a29a66de94fa65cdb52b0d51c (diff)
Rollup merge of #127687 - RalfJung:pattern-cleanup, r=oli-obk,lcnr
Const-to-pattern-to-MIR cleanup

Now that all uses of constants without structural equality are hard errors, there's a bunch of cleanup we can do in the code that handles patterns: we can always funnel patterns through valtrees first (rather than having a fallback path for when valtree construction fails), and we can make sure that if we emit a `PartialEq` call it is not calling anything user-defined.

To keep the error messages the same, I made valtree construction failures return the information of *which* type it is that cannot be valtree'd. `search_for_structural_match_violation` is now not needed any more at all, so I removed it.

r? `@oli-obk`
Diffstat (limited to 'src')
-rw-r--r--src/tools/clippy/clippy_lints/src/non_copy_const.rs2
-rw-r--r--src/tools/tidy/src/issues.txt1
2 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/clippy/clippy_lints/src/non_copy_const.rs b/src/tools/clippy/clippy_lints/src/non_copy_const.rs
index 09225ac3246..6f5505e8a63 100644
--- a/src/tools/clippy/clippy_lints/src/non_copy_const.rs
+++ b/src/tools/clippy/clippy_lints/src/non_copy_const.rs
@@ -235,7 +235,7 @@ impl<'tcx> NonCopyConst<'tcx> {
 
     fn is_value_unfrozen_raw(
         cx: &LateContext<'tcx>,
-        result: Result<Option<ty::ValTree<'tcx>>, ErrorHandled>,
+        result: Result<Result<ty::ValTree<'tcx>, Ty<'tcx>>, ErrorHandled>,
         ty: Ty<'tcx>,
     ) -> bool {
         result.map_or_else(
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
index 3c7284ce6db..57310977704 100644
--- a/src/tools/tidy/src/issues.txt
+++ b/src/tools/tidy/src/issues.txt
@@ -3449,7 +3449,6 @@ ui/pattern/issue-6449.rs
 ui/pattern/issue-66270-pat-struct-parser-recovery.rs
 ui/pattern/issue-67037-pat-tup-scrut-ty-diff-less-fields.rs
 ui/pattern/issue-67776-match-same-name-enum-variant-refs.rs
-ui/pattern/issue-68393-let-pat-assoc-constant.rs
 ui/pattern/issue-72565.rs
 ui/pattern/issue-72574-1.rs
 ui/pattern/issue-72574-2.rs