diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-11 16:50:20 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-04-15 08:06:59 +1000 |
| commit | b26f3d4347ca589305a19d10c6e651b071849716 (patch) | |
| tree | a5e7abe985cbe691492dda7810e8f04f16c609df /compiler/rustc_middle/src/ty/mod.rs | |
| parent | ce2aa97cd647bdfcb5859489d93526622bb388a0 (diff) | |
| download | rust-b26f3d4347ca589305a19d10c6e651b071849716.tar.gz rust-b26f3d4347ca589305a19d10c6e651b071849716.zip | |
Move `opt_rpitit_info` field to `hir::AssocKind::Type`.
From `hir::AssocItem`.
Diffstat (limited to 'compiler/rustc_middle/src/ty/mod.rs')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index 30c889c39d9..395d2ec4814 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -1610,8 +1610,10 @@ impl<'tcx> TyCtxt<'tcx> { /// return-position `impl Trait` from a trait, then provide the source info /// about where that RPITIT came from. pub fn opt_rpitit_info(self, def_id: DefId) -> Option<ImplTraitInTraitData> { - if let DefKind::AssocTy = self.def_kind(def_id) { - self.associated_item(def_id).opt_rpitit_info + if let DefKind::AssocTy = self.def_kind(def_id) + && let AssocKind::Type { opt_rpitit_info } = self.associated_item(def_id).kind + { + opt_rpitit_info } else { None } |
