about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lints.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-21 09:18:48 +0000
committerbors <bors@rust-lang.org>2024-01-21 09:18:48 +0000
commitcb25c5bc3d526a8fb931314cb3a7849115134b04 (patch)
tree3796402da73b4643ceecc186bf4bbba17d0b1229 /compiler/rustc_pattern_analysis/src/lints.rs
parent867d39cdf625e4db4b381faff993346582e598b4 (diff)
parent01669d27d2e9e26ab247a8f6ae78a9673513c7dd (diff)
downloadrust-cb25c5bc3d526a8fb931314cb3a7849115134b04.tar.gz
rust-cb25c5bc3d526a8fb931314cb3a7849115134b04.zip
Auto merge of #120187 - Nadrieril:rollup-xfwrb0c, r=Nadrieril
Rollup of 8 pull requests

Successful merges:

 - #116090 (Implement strict integer operations that panic on overflow)
 - #118811 (Use `bool` instead of `PartiolOrd` as return value of the comparison closure in `{slice,Iteraotr}::is_sorted_by`)
 - #119081 (Add Ipv6Addr::is_ipv4_mapped)
 - #119461 (Use an interpreter in MIR jump threading)
 - #119996 (Move OS String implementation into `sys`)
 - #120015 (coverage: Format all coverage tests with `rustfmt`)
 - #120027 (pattern_analysis: Remove `Ty: Copy` bound)
 - #120084 (fix(rust-analyzer): use new pkgid spec to compare)

r? `@ghost`
`@rustbot` modify labels: rollup
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() {