Keep reference to the original Pat in DeconstructedPat
This commit is contained in:
@@ -203,7 +203,7 @@ pub(crate) fn lint_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
|
||||
};
|
||||
|
||||
use rustc_errors::DecorateLint;
|
||||
let mut err = rcx.tcx.dcx().struct_span_warn(*arm.pat.data().unwrap(), "");
|
||||
let mut err = rcx.tcx.dcx().struct_span_warn(arm.pat.data().unwrap().span, "");
|
||||
err.set_primary_message(decorator.msg());
|
||||
decorator.decorate_lint(&mut err);
|
||||
err.emit();
|
||||
@@ -254,7 +254,7 @@ pub(crate) fn lint_overlapping_range_endpoints<'a, 'p, 'tcx>(
|
||||
// Iterate on patterns that contained `overlap`.
|
||||
for pat in column.iter() {
|
||||
let Constructor::IntRange(this_range) = pat.ctor() else { continue };
|
||||
let this_span = *pat.data().unwrap();
|
||||
let this_span = pat.data().unwrap().span;
|
||||
if this_range.is_singleton() {
|
||||
// Don't lint when one of the ranges is a singleton.
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user