We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 66500ef commit c678103Copy full SHA for c678103
src/librustc/ty/context.rs
@@ -1520,10 +1520,11 @@ impl<'tcx> TyCtxt<'tcx> {
1520
let kind = self.def_kind(def_id).unwrap();
1521
(kind.article(), kind.descr(def_id))
1522
}
1523
- DefPathData::ClosureExpr => {
1524
- // TODO
1525
- todo!();
1526
- }
+ 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"),
1527
+ },
1528
_ => bug!("article_and_description called on def_id {:?}", def_id),
1529
1530
0 commit comments