article and descr for closures
This commit is contained in:
parent
66500effea
commit
c6781037eb
1 changed files with 5 additions and 4 deletions
|
|
@ -1520,10 +1520,11 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
let kind = self.def_kind(def_id).unwrap();
|
||||
(kind.article(), kind.descr(def_id))
|
||||
}
|
||||
DefPathData::ClosureExpr => {
|
||||
// TODO
|
||||
todo!();
|
||||
}
|
||||
DefPathData::ClosureExpr => match self.generator_kind(def_id) {
|
||||
None => ("a", "closure"),
|
||||
Some(rustc_hir::GeneratorKind::Async(..)) => ("an", "async closure"),
|
||||
Some(rustc_hir::GeneratorKind::Gen) => ("a", "generator"),
|
||||
},
|
||||
_ => bug!("article_and_description called on def_id {:?}", def_id),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue