diff options
| author | bors <bors@rust-lang.org> | 2022-12-19 19:21:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-19 19:21:35 +0000 |
| commit | 935dc07218b4bf6e20231e44eb9263b612fd649b (patch) | |
| tree | 7f23c9ee1cc4a2b3a7160dac735c5e510636b375 /compiler/rustc_middle | |
| parent | 7ab803891dd95a04f3b2143e40b26f03b608b4bc (diff) | |
| parent | f705d646738ea8b1238e1c9a58c16532cc4d73a6 (diff) | |
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
Address some `EarlyBinder` nits
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/ty/util.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/util.rs b/compiler/rustc_middle/src/ty/util.rs index 857f52c8a24..5d0af1d4ead 100644 --- a/compiler/rustc_middle/src/ty/util.rs +++ b/compiler/rustc_middle/src/ty/util.rs @@ -3,6 +3,7 @@ use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; use crate::mir; use crate::ty::layout::IntegerExt; +use crate::ty::query::TyCtxtAt; use crate::ty::{ self, DefIdTree, FallibleTypeFolder, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, TypeVisitable, @@ -769,6 +770,12 @@ impl<'tcx> TyCtxt<'tcx> { } } +impl<'tcx> TyCtxtAt<'tcx> { + pub fn bound_type_of(self, def_id: DefId) -> ty::EarlyBinder<Ty<'tcx>> { + ty::EarlyBinder(self.type_of(def_id)) + } +} + struct OpaqueTypeExpander<'tcx> { // Contains the DefIds of the opaque types that are currently being // expanded. When we expand an opaque type we insert the DefId of |
