Skip to content

Commit d3d0287

Browse files
Rollup merge of #118863 - Enselic:rustc_mir-build-query-stability, r=michaelwoerister
rustc_mir_build: Enforce `rustc::potential_query_instability` lint Stop allowing `rustc::potential_query_instability` on all of `rustc_mir_build` and instead allow it on a case-by-case basis if it is safe to do so. In this crate there was only one instance of the lint, and it was safe to allow. Part of #84447 which is E-help-wanted.
2 parents f8b9269 + 5644a53 commit d3d0287

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

compiler/rustc_mir_build/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//! Construction of MIR from HIR.
22
//!
33
//! This crate also contains the match exhaustiveness and usefulness checking.
4-
#![allow(rustc::potential_query_instability)]
54
#![feature(assert_matches)]
65
#![feature(associated_type_bounds)]
76
#![feature(box_patterns)]

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::errors::*;
99

1010
use rustc_arena::TypedArena;
1111
use rustc_ast::Mutability;
12-
use rustc_data_structures::fx::FxHashSet;
12+
use rustc_data_structures::fx::FxIndexSet;
1313
use rustc_data_structures::stack::ensure_sufficient_stack;
1414
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed, MultiSpan};
1515
use rustc_hir as hir;
@@ -948,7 +948,7 @@ fn report_non_exhaustive_match<'p, 'tcx>(
948948
err.note(format!("the matched value is of type `{}`", scrut_ty));
949949

950950
if !is_empty_match {
951-
let mut non_exhaustive_tys = FxHashSet::default();
951+
let mut non_exhaustive_tys = FxIndexSet::default();
952952
// Look at the first witness.
953953
collect_non_exhaustive_tys(cx, &witnesses[0], &mut non_exhaustive_tys);
954954

@@ -1104,7 +1104,7 @@ fn joined_uncovered_patterns<'p, 'tcx>(
11041104
fn collect_non_exhaustive_tys<'tcx>(
11051105
cx: &MatchCheckCtxt<'_, 'tcx>,
11061106
pat: &WitnessPat<'tcx>,
1107-
non_exhaustive_tys: &mut FxHashSet<Ty<'tcx>>,
1107+
non_exhaustive_tys: &mut FxIndexSet<Ty<'tcx>>,
11081108
) {
11091109
if matches!(pat.ctor(), Constructor::NonExhaustive) {
11101110
non_exhaustive_tys.insert(pat.ty());

0 commit comments

Comments
 (0)