]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir/src/hir.rs
Store LocalDefId in hir::Closure.
[rust.git] / compiler / rustc_hir / src / hir.rs
index ef00c1ffc302d9ab12e510db364b7357c2b0fe5c..1be03552c88ad5c9711d7623f18d1f4b31edeb47 100644 (file)
@@ -388,6 +388,8 @@ pub fn has_lifetime_params(&self) -> bool {
     }
 
     #[inline]
+    /// This function returns the number of type and const generic params.
+    /// It should only be used for diagnostics.
     pub fn num_generic_params(&self) -> usize {
         self.args.iter().filter(|arg| !matches!(arg, GenericArg::Lifetime(_))).count()
     }
@@ -919,6 +921,7 @@ pub struct Crate<'hir> {
 
 #[derive(Debug, HashStable_Generic)]
 pub struct Closure<'hir> {
+    pub def_id: LocalDefId,
     pub binder: ClosureBinder,
     pub capture_clause: CaptureBy,
     pub bound_generic_params: &'hir [GenericParam<'hir>],