diff options
| author | makai410 <m4kai410@gmail.com> | 2025-04-01 17:11:53 +0800 |
|---|---|---|
| committer | makai410 <m4kai410@gmail.com> | 2025-04-01 17:11:53 +0800 |
| commit | f9ef4563c23d81dff49a3cc4443202358426e3bd (patch) | |
| tree | edc137c6fad3169820f886e52218406087b66b3d /compiler/stable_mir/src/compiler_interface.rs | |
| parent | eda7820be557755217e04242f195d1530524f399 (diff) | |
| download | rust-f9ef4563c23d81dff49a3cc4443202358426e3bd.tar.gz rust-f9ef4563c23d81dff49a3cc4443202358426e3bd.zip | |
Implement `associated_items` api.
Diffstat (limited to 'compiler/stable_mir/src/compiler_interface.rs')
| -rw-r--r-- | compiler/stable_mir/src/compiler_interface.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/stable_mir/src/compiler_interface.rs b/compiler/stable_mir/src/compiler_interface.rs index e82c957c34e..46154da36ca 100644 --- a/compiler/stable_mir/src/compiler_interface.rs +++ b/compiler/stable_mir/src/compiler_interface.rs @@ -18,8 +18,8 @@ use crate::ty::{ TraitDef, Ty, TyConst, TyConstId, TyKind, UintTy, VariantDef, }; use crate::{ - Crate, CrateItem, CrateItems, CrateNum, DefId, Error, Filename, ImplTraitDecls, ItemKind, - Symbol, TraitDecls, mir, + AssocItems, Crate, CrateItem, CrateItems, CrateNum, DefId, Error, Filename, ImplTraitDecls, + ItemKind, Symbol, TraitDecls, mir, }; /// This trait defines the interface between stable_mir and the Rust compiler. @@ -251,6 +251,9 @@ pub trait Context { /// Get the resulting type of unary operation. fn unop_ty(&self, un_op: UnOp, arg: Ty) -> Ty; + + /// Get all associated items of a definition. + fn associated_items(&self, def_id: DefId) -> AssocItems; } // A thread local variable that stores a pointer to the tables mapping between TyCtxt |
