mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Store a LocalDefId in hir::Variant & hir::Field.
This commit is contained in:
parent
7ddd321ecd
commit
e6ef478877
2 changed files with 4 additions and 4 deletions
|
@ -157,10 +157,10 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustiveEnum {
|
|||
&& def.variants.len() > 1
|
||||
{
|
||||
let mut iter = def.variants.iter().filter_map(|v| {
|
||||
let id = cx.tcx.hir().local_def_id(v.id);
|
||||
(matches!(v.data, hir::VariantData::Unit(_))
|
||||
let id = cx.tcx.hir().local_def_id(v.hir_id);
|
||||
(matches!(v.data, hir::VariantData::Unit(..))
|
||||
&& v.ident.as_str().starts_with('_')
|
||||
&& is_doc_hidden(cx.tcx.hir().attrs(v.id)))
|
||||
&& is_doc_hidden(cx.tcx.hir().attrs(v.hir_id)))
|
||||
.then_some((id, v.span))
|
||||
});
|
||||
if let Some((id, span)) = iter.next()
|
||||
|
|
|
@ -199,7 +199,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
|
|||
}
|
||||
|
||||
fn check_variant(&mut self, cx: &LateContext<'tcx>, v: &'tcx hir::Variant<'_>) {
|
||||
let attrs = cx.tcx.hir().attrs(v.id);
|
||||
let attrs = cx.tcx.hir().attrs(v.hir_id);
|
||||
if !is_from_proc_macro(cx, v) {
|
||||
self.check_missing_docs_attrs(cx, attrs, v.span, "a", "variant");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue