Abstract MatchCheckCtxt
into a trait
This commit is contained in:
parent
3ad76f9325
commit
3d7c4df326
8 changed files with 313 additions and 239 deletions
|
@ -1,11 +1,11 @@
|
|||
use crate::{cx::MatchCheckCtxt, pat::WitnessPat};
|
||||
|
||||
use rustc_errors::{AddToDiagnostic, Diagnostic, SubdiagnosticMessage};
|
||||
use rustc_macros::{LintDiagnostic, Subdiagnostic};
|
||||
use rustc_middle::thir::Pat;
|
||||
use rustc_middle::ty::Ty;
|
||||
use rustc_span::Span;
|
||||
|
||||
use crate::cx::{MatchCheckCtxt, WitnessPat};
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(pattern_analysis_uncovered)]
|
||||
pub struct Uncovered<'tcx> {
|
||||
|
@ -22,7 +22,7 @@ impl<'tcx> Uncovered<'tcx> {
|
|||
pub fn new<'p>(
|
||||
span: Span,
|
||||
cx: &MatchCheckCtxt<'p, 'tcx>,
|
||||
witnesses: Vec<WitnessPat<'tcx>>,
|
||||
witnesses: Vec<WitnessPat<'p, 'tcx>>,
|
||||
) -> Self {
|
||||
let witness_1 = cx.hoist_witness_pat(witnesses.get(0).unwrap());
|
||||
Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue