Skip to content

Commit

Permalink
Fix omitted_patterns lint showing unstable/doc hidden fields
Browse files Browse the repository at this point in the history
  • Loading branch information
DevinR528 committed Mar 12, 2022
1 parent 22a20e3 commit 8663ee1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_typeck/src/check/pat.rs
Expand Up @@ -12,6 +12,7 @@ use rustc_hir::{HirId, Pat, PatKind};
use rustc_infer::infer;
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_middle::ty::{self, Adt, BindingMode, Ty, TypeFoldable};
use rustc_middle::{middle::stability::EvalResult, ty::subst::GenericArg};
use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
use rustc_span::hygiene::DesugaringKind;
use rustc_span::lev_distance::find_best_match_for_name;
Expand Down Expand Up @@ -1308,6 +1309,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.copied()
.filter(|(field, _)| {
field.vis.is_accessible_from(tcx.parent_module(pat.hir_id).to_def_id(), tcx)
&& !matches!(
tcx.eval_stability(field.did, None, DUMMY_SP, None),
EvalResult::Deny { .. }
)
&& !tcx.is_doc_hidden(field.did)
})
.collect();

Expand Down

0 comments on commit 8663ee1

Please sign in to comment.