We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e2f5a5a commit 8d5ee1aCopy full SHA for 8d5ee1a
compiler/rustc_middle/src/hir/mod.rs
@@ -105,12 +105,10 @@ impl<'tcx> TyCtxt<'tcx> {
105
}
106
107
pub fn impl_subject(self, def_id: DefId) -> EarlyBinder<ImplSubject<'tcx>> {
108
- EarlyBinder(
109
- self.impl_trait_ref(def_id)
110
- .map(|t| t.subst_identity())
111
- .map(ImplSubject::Trait)
112
- .unwrap_or_else(|| ImplSubject::Inherent(self.type_of(def_id).subst_identity())),
113
- )
+ match self.impl_trait_ref(def_id) {
+ Some(t) => t.map_bound(ImplSubject::Trait),
+ None => self.type_of(def_id).map_bound(ImplSubject::Inherent),
+ }
114
115
116
0 commit comments