From 6e4d7bd90e58ad0e26458b277d1c7e7f4401734d Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 5 Aug 2023 22:08:30 -0300 Subject: [PATCH] Add TraitDef::trait_decl method --- compiler/rustc_smir/src/stable_mir/ty.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/rustc_smir/src/stable_mir/ty.rs b/compiler/rustc_smir/src/stable_mir/ty.rs index 03089fef01a99..c487db5b732a5 100644 --- a/compiler/rustc_smir/src/stable_mir/ty.rs +++ b/compiler/rustc_smir/src/stable_mir/ty.rs @@ -105,6 +105,12 @@ pub struct AliasDef(pub(crate) DefId); #[derive(Clone, PartialEq, Eq, Debug)] pub struct TraitDef(pub(crate) DefId); +impl TraitDef { + pub fn trait_decl(&self) -> TraitDecl { + with(|cx| cx.trait_decl(self)) + } +} + #[derive(Clone, Debug)] pub struct GenericArgs(pub Vec);