Allow struct field default values to reference struct's generics
This commit is contained in:
parent
e16a049adb
commit
3e5fddc95e
8 changed files with 112 additions and 19 deletions
|
@ -187,6 +187,8 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
|
|||
Some(parent_did)
|
||||
}
|
||||
Node::TyPat(_) => Some(parent_did),
|
||||
// Field default values inherit the ADT's generics.
|
||||
Node::Field(_) => Some(parent_did),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue