pattern_analysis
doesn't need to know what spans are
This commit is contained in:
parent
8c5e89907c
commit
1e89a38423
6 changed files with 39 additions and 36 deletions
|
@ -213,7 +213,7 @@ pub(crate) fn lint_nonexhaustive_missing_variants<'a, 'p, 'tcx>(
|
|||
};
|
||||
|
||||
use rustc_errors::DecorateLint;
|
||||
let mut err = cx.tcx.sess.struct_span_warn(*arm.pat.span(), "");
|
||||
let mut err = cx.tcx.sess.struct_span_warn(*arm.pat.data(), "");
|
||||
err.set_primary_message(decorator.msg());
|
||||
decorator.decorate_lint(&mut err);
|
||||
err.emit();
|
||||
|
@ -263,7 +263,7 @@ pub(crate) fn lint_overlapping_range_endpoints<'a, 'p, 'tcx>(
|
|||
let mut suffixes: SmallVec<[_; 1]> = Default::default();
|
||||
// Iterate on patterns that contained `overlap`.
|
||||
for pat in column.iter() {
|
||||
let this_span = *pat.span();
|
||||
let this_span = *pat.data();
|
||||
let Constructor::IntRange(this_range) = pat.ctor() else { continue };
|
||||
if this_range.is_singleton() {
|
||||
// Don't lint when one of the ranges is a singleton.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue