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();
|
let item = parser.parse_item(ForceCollect::Yes)?.unwrap();
|
||||||
Annotatable::Item(self.flat_map_item(item).pop().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();
|
let item = parser.parse_trait_item(ForceCollect::Yes)?.unwrap().unwrap();
|
||||||
Annotatable::AssocItem(
|
Annotatable::AssocItem(
|
||||||
self.flat_map_assoc_item(item, AssocCtxt::Trait).pop().unwrap(),
|
self.flat_map_assoc_item(item, ctxt).pop().unwrap(),
|
||||||
AssocCtxt::Trait,
|
ctxt,
|
||||||
)
|
|
||||||
}
|
|
||||||
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,
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Annotatable::ForeignItem(_) => {
|
Annotatable::ForeignItem(_) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue