Skip to content

Commit d91a374

Browse files
Rename rustc_pattern_analysis/src/errors.rs into rustc_pattern_analysis/src/diagnostics.rs
1 parent 5e9f030 commit d91a374

6 files changed

Lines changed: 13 additions & 11 deletions

File tree

compiler/rustc_mir_build/src/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use rustc_errors::{
55
};
66
use rustc_macros::{Diagnostic, Subdiagnostic};
77
use rustc_middle::ty::{self, Ty};
8-
use rustc_pattern_analysis::errors::Uncovered;
8+
use rustc_pattern_analysis::diagnostics::Uncovered;
99
use rustc_pattern_analysis::rustc::RustcPatCtxt;
1010
use rustc_span::{Ident, Span, Symbol};
1111

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use rustc_middle::thir::visit::Visitor;
1313
use rustc_middle::thir::*;
1414
use rustc_middle::ty::print::with_no_trimmed_paths;
1515
use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt};
16-
use rustc_pattern_analysis::errors::Uncovered;
16+
use rustc_pattern_analysis::diagnostics::Uncovered;
1717
use rustc_pattern_analysis::rustc::{
1818
Constructor, DeconstructedPat, MatchArm, RedundancyExplanation, RevealedTy,
1919
RustcPatCtxt as PatCtxt, Usefulness, UsefulnessReport, WitnessPat,
File renamed without changes.

compiler/rustc_pattern_analysis/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pub(crate) mod checks;
1010
pub mod constructor;
1111
#[cfg(feature = "rustc")]
12-
pub mod errors;
12+
pub mod diagnostics;
1313
#[cfg(feature = "rustc")]
1414
pub(crate) mod lints;
1515
pub mod pat;

compiler/rustc_pattern_analysis/src/lints.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use tracing::instrument;
44

55
use crate::MatchArm;
66
use crate::constructor::Constructor;
7-
use crate::errors::{NonExhaustiveOmittedPattern, NonExhaustiveOmittedPatternLintOnArm, Uncovered};
7+
use crate::diagnostics::{
8+
NonExhaustiveOmittedPattern, NonExhaustiveOmittedPatternLintOnArm, Uncovered,
9+
};
810
use crate::pat_column::PatternColumn;
911
use crate::rustc::{RevealedTy, RustcPatCtxt, WitnessPat};
1012

compiler/rustc_pattern_analysis/src/rustc.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::lints::lint_nonexhaustive_missing_variants;
2525
use crate::pat_column::PatternColumn;
2626
use crate::rustc::print::EnumInfo;
2727
use crate::usefulness::{PlaceValidity, compute_match_usefulness};
28-
use crate::{PatCx, PrivateUninhabitedField, errors};
28+
use crate::{PatCx, PrivateUninhabitedField, diagnostics};
2929

3030
mod print;
3131

@@ -949,14 +949,14 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
949949
let overlaps: Vec<_> = overlaps_with
950950
.iter()
951951
.map(|pat| pat.data().span)
952-
.map(|span| errors::Overlap { range: overlap_as_pat.to_string(), span })
952+
.map(|span| diagnostics::Overlap { range: overlap_as_pat.to_string(), span })
953953
.collect();
954954
let pat_span = pat.data().span;
955955
self.tcx.emit_node_span_lint(
956956
lint::builtin::OVERLAPPING_RANGE_ENDPOINTS,
957957
self.match_lint_level,
958958
pat_span,
959-
errors::OverlappingRangeEndpoints { overlap: overlaps, range: pat_span },
959+
diagnostics::OverlappingRangeEndpoints { overlap: overlaps, range: pat_span },
960960
);
961961
}
962962

@@ -992,7 +992,7 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
992992
lint::builtin::NON_CONTIGUOUS_RANGE_ENDPOINTS,
993993
self.match_lint_level,
994994
thir_pat.span,
995-
errors::ExclusiveRangeMissingMax {
995+
diagnostics::ExclusiveRangeMissingMax {
996996
// Point at this range.
997997
first_range: thir_pat.span,
998998
// That's the gap that isn't covered.
@@ -1006,7 +1006,7 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
10061006
lint::builtin::NON_CONTIGUOUS_RANGE_ENDPOINTS,
10071007
self.match_lint_level,
10081008
thir_pat.span,
1009-
errors::ExclusiveRangeMissingGap {
1009+
diagnostics::ExclusiveRangeMissingGap {
10101010
// Point at this range.
10111011
first_range: thir_pat.span,
10121012
// That's the gap that isn't covered.
@@ -1017,7 +1017,7 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
10171017
// mistake.
10181018
gap_with: gapped_with
10191019
.iter()
1020-
.map(|pat| errors::GappedRange {
1020+
.map(|pat| diagnostics::GappedRange {
10211021
span: pat.data().span,
10221022
gap: gap_as_pat.to_string(),
10231023
first_range: range.to_string(),
@@ -1039,7 +1039,7 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
10391039
) -> Self::Error {
10401040
let deref_pattern_label = deref_pat.data().span;
10411041
let normal_constructor_label = normal_pat.data().span;
1042-
self.tcx.dcx().emit_err(errors::MixedDerefPatternConstructors {
1042+
self.tcx.dcx().emit_err(diagnostics::MixedDerefPatternConstructors {
10431043
spans: vec![deref_pattern_label, normal_constructor_label],
10441044
smart_pointer_ty: deref_pat.ty().inner(),
10451045
deref_pattern_label,

0 commit comments

Comments
 (0)