Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/builder/matches/match_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ impl<'tcx> MatchPairTree<'tcx> {
}

PatKind::Range(ref range) => {
assert_eq!(pattern.ty, range.ty);
if range.is_full_range(cx.tcx) == Some(true) {
None
} else {
Expand Down Expand Up @@ -380,7 +381,6 @@ impl<'tcx> MatchPairTree<'tcx> {
place,
testable_case,
subpairs,
pattern_ty: pattern.ty,
pattern_span: pattern.span,
})
} else {
Expand Down
6 changes: 2 additions & 4 deletions compiler/rustc_mir_build/src/builder/matches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ enum PatConstKind {
/// tested, and a test to perform on that place.
///
/// Each node also has a list of subpairs (possibly empty) that must also match,
/// and a reference to the THIR pattern it represents.
/// and some additional information from the THIR pattern it represents.
#[derive(Debug, Clone)]
pub(crate) struct MatchPairTree<'tcx> {
/// This place...
Expand All @@ -1301,9 +1301,7 @@ pub(crate) struct MatchPairTree<'tcx> {
/// that tests its field for the value `3`.
subpairs: Vec<Self>,

/// Type field of the pattern this node was created from.
pattern_ty: Ty<'tcx>,
/// Span field of the pattern this node was created from.
/// Span field of the THIR pattern this node was created from.
pattern_span: Span,
}

Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_mir_build/src/builder/matches/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
TestKind::ScalarEq { value }
}

TestableCase::Range(ref range) => {
assert_eq!(range.ty, match_pair.pattern_ty);
TestKind::Range(Arc::clone(range))
}
TestableCase::Range(ref range) => TestKind::Range(Arc::clone(range)),

TestableCase::Slice { len, op } => TestKind::SliceLen { len, op },

Expand Down
Loading