Skip to content

Commit

Permalink
Put back original field discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 31, 2018
1 parent d5f1f70 commit d94bdf8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1211,8 +1211,14 @@ fn resolve(cx: &DocContext, path_str: &str, is_val: bool) -> Result<(Def, Option
} else {
match cx.tcx.type_of(did).sty {
ty::TyAdt(def, _) => {
if let Some(item) = def.all_fields()
.find(|item| item.ident.name == item_name) {
if let Some(item) = if def.is_enum() {
def.all_fields().find(|item| item.ident.name == item_name)
} else {
def.non_enum_variant()
.fields
.iter()
.find(|item| item.ident.name == item_name)
} {
Ok((ty.def,
Some(format!("{}.{}",
if def.is_enum() {
Expand Down

0 comments on commit d94bdf8

Please sign in to comment.