about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lints.rs
diff options
context:
space:
mode:
authorNadrieril <Nadrieril@users.noreply.github.com>2024-01-21 06:38:38 +0100
committerGitHub <noreply@github.com>2024-01-21 06:38:38 +0100
commite7f3dc76f5acbf3d1763701158f3867ef09bbc01 (patch)
treee6a1d691b4657af635db44ef503acc399b40e704 /compiler/rustc_pattern_analysis/src/lints.rs
parente8678b1030c50173ff29d77eae215b1f8472571d (diff)
parent796cdc590c0f6badb9629feb2a2b55873408cc0f (diff)
downloadrust-e7f3dc76f5acbf3d1763701158f3867ef09bbc01.tar.gz
rust-e7f3dc76f5acbf3d1763701158f3867ef09bbc01.zip
Rollup merge of #120027 - Nadrieril:remove-ty-copy-bound, r=compiler-errors
pattern_analysis: Remove `Ty: Copy` bound

To make it compatible with rust-analyzer's `Ty` which isn't `Copy` (it's an `Arc`).

r? ``@compiler-errors``
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lints.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lints.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lints.rs b/compiler/rustc_pattern_analysis/src/lints.rs
index d9dbd8250ef..f9f065fbe8b 100644
--- a/compiler/rustc_pattern_analysis/src/lints.rs
+++ b/compiler/rustc_pattern_analysis/src/lints.rs
@@ -46,7 +46,7 @@ impl<'p, 'tcx> PatternColumn<'p, 'tcx> {
     }
 
     fn head_ty(&self) -> Option<RevealedTy<'tcx>> {
-        self.patterns.first().map(|pat| pat.ty())
+        self.patterns.first().map(|pat| *pat.ty())
     }
 
     /// Do constructor splitting on the constructors of the column.
@@ -101,7 +101,7 @@ fn collect_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
     let Some(ty) = column.head_ty() else {
         return Ok(Vec::new());
     };
-    let pcx = &PlaceCtxt::new_dummy(cx, ty);
+    let pcx = &PlaceCtxt::new_dummy(cx, &ty);
 
     let set = column.analyze_ctors(pcx)?;
     if set.present.is_empty() {