Skip to content

Commit c024a95

Browse files
committed
Auto 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.
2 parents a1db344 + 4e02b6d commit c024a95

File tree

1 file changed

+2
-6
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+2
-6
lines changed

compiler/rustc_middle/src/ty/util.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,8 @@ impl<'tcx> TyCtxt<'tcx> {
642642
/// has its own type-checking context or "inference environment".
643643
///
644644
/// For example, a closure has its own `DefId`, but it is type-checked
645-
/// with the containing item. Similarly, an inline const block has its
646-
/// own `DefId` but it is type-checked together with the containing item.
647-
///
648-
/// Therefore, when we fetch the
649-
/// `typeck` the closure, for example, we really wind up
650-
/// fetching the `typeck` the enclosing fn item.
645+
/// with the containing item. Therefore, when we fetch the `typeck` of the closure,
646+
/// for example, we really wind up fetching the `typeck` of the enclosing fn item.
651647
pub fn typeck_root_def_id(self, def_id: DefId) -> DefId {
652648
let mut def_id = def_id;
653649
while self.is_typeck_child(def_id) {

0 commit comments

Comments
 (0)