]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/mod.rs
Rollup merge of #81318 - CraftSpider:json-trait-fix, r=jyn514
[rust.git] / compiler / rustc_middle / src / ty / mod.rs
index 7681041863e9ad1fc75fc3103dbdfc1bc0d498ff..babab005edb2b3a85c7dd53644b012b00635069a 100644 (file)
@@ -675,6 +675,8 @@ pub struct CapturedPlace<'tcx> {
 }
 
 impl CapturedPlace<'tcx> {
+    /// Returns the hir-id of the root variable for the captured place.
+    /// e.g., if `a.b.c` was captured, would return the hir-id for `a`.
     pub fn get_root_variable(&self) -> hir::HirId {
         match self.place.base {
             HirPlaceBase::Upvar(upvar_id) => upvar_id.var_path.hir_id,