Deduplicate assoc item cfg handling
This commit is contained in:
parent
e61403aa4c
commit
502d57cb78
1 changed files with 3 additions and 10 deletions
|
@ -121,18 +121,11 @@ impl CfgEval<'_> {
|
|||
let item = parser.parse_item(ForceCollect::Yes)?.unwrap();
|
||||
Annotatable::Item(self.flat_map_item(item).pop().unwrap())
|
||||
}
|
||||
Annotatable::AssocItem(_, AssocCtxt::Trait) => {
|
||||
Annotatable::AssocItem(_, ctxt) => {
|
||||
let item = parser.parse_trait_item(ForceCollect::Yes)?.unwrap().unwrap();
|
||||
Annotatable::AssocItem(
|
||||
self.flat_map_assoc_item(item, AssocCtxt::Trait).pop().unwrap(),
|
||||
AssocCtxt::Trait,
|
||||
)
|
||||
}
|
||||
Annotatable::AssocItem(_, AssocCtxt::Impl) => {
|
||||
let item = parser.parse_impl_item(ForceCollect::Yes)?.unwrap().unwrap();
|
||||
Annotatable::AssocItem(
|
||||
self.flat_map_assoc_item(item, AssocCtxt::Impl).pop().unwrap(),
|
||||
AssocCtxt::Impl,
|
||||
self.flat_map_assoc_item(item, ctxt).pop().unwrap(),
|
||||
ctxt,
|
||||
)
|
||||
}
|
||||
Annotatable::ForeignItem(_) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue