Rollup merge of #151927 - tshepang:patch-1, r=Kivooeo
typeck_root_def_id: improve doc comment This was initially written to be exhaustive, but one more type that can only be type-checked with its containing item has since been added, and was not mentioned. So, make it future-proof by mentioning just the one example. Also, a previous refactor left this less readable.
This commit is contained in:
commit
394e519690
1 changed files with 2 additions and 6 deletions
|
|
@ -642,12 +642,8 @@ impl<'tcx> TyCtxt<'tcx> {
|
|||
/// has its own type-checking context or "inference environment".
|
||||
///
|
||||
/// For example, a closure has its own `DefId`, but it is type-checked
|
||||
/// with the containing item. Similarly, an inline const block has its
|
||||
/// own `DefId` but it is type-checked together with the containing item.
|
||||
///
|
||||
/// Therefore, when we fetch the
|
||||
/// `typeck` the closure, for example, we really wind up
|
||||
/// fetching the `typeck` the enclosing fn item.
|
||||
/// with the containing item. Therefore, when we fetch the `typeck` of the closure,
|
||||
/// for example, we really wind up fetching the `typeck` of the enclosing fn item.
|
||||
pub fn typeck_root_def_id(self, def_id: DefId) -> DefId {
|
||||
let mut def_id = def_id;
|
||||
while self.is_typeck_child(def_id) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue