提交 8663ee19 编写于 作者: D Devin Ragotzy

Fix omitted_patterns lint showing unstable/doc hidden fields

上级 22a20e3f
......@@ -12,6 +12,7 @@
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;
......@@ -1308,6 +1309,11 @@ fn check_struct_pat_fields(
.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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册