diff options
| author | Jana Dönszelmann <jana@donsz.nl> | 2025-02-09 22:50:08 +0100 |
|---|---|---|
| committer | Jana Dönszelmann <jana@donsz.nl> | 2025-02-24 14:31:19 +0100 |
| commit | d8ea2a230f2a0aa77a544bc609baf6a3caab060e (patch) | |
| tree | dbc8057393a0d60addc98a5ed586d20c31280e9f /compiler/stable_mir/src/compiler_interface.rs | |
| parent | 95b52d51eac77be1fcc624c2278dcaafa6989b0b (diff) | |
| download | rust-d8ea2a230f2a0aa77a544bc609baf6a3caab060e.tar.gz rust-d8ea2a230f2a0aa77a544bc609baf6a3caab060e.zip | |
change smir attributes getters to only support tool attributes
Diffstat (limited to 'compiler/stable_mir/src/compiler_interface.rs')
| -rw-r--r-- | compiler/stable_mir/src/compiler_interface.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/compiler/stable_mir/src/compiler_interface.rs b/compiler/stable_mir/src/compiler_interface.rs index a6f7c254583..e82c957c34e 100644 --- a/compiler/stable_mir/src/compiler_interface.rs +++ b/compiler/stable_mir/src/compiler_interface.rs @@ -62,14 +62,17 @@ pub trait Context { /// Returns the name of given `DefId` fn def_name(&self, def_id: DefId, trimmed: bool) -> Symbol; - /// Return attributes with the given attribute name. + /// Return registered tool attributes with the given attribute name. /// - /// Single segmented name like `#[inline]` is specified as `&["inline".to_string()]`. + /// FIXME(jdonszelmann): may panic on non-tool attributes. After more attribute work, non-tool + /// attributes will simply return an empty list. + /// + /// Single segmented name like `#[clippy]` is specified as `&["clippy".to_string()]`. /// Multi-segmented name like `#[rustfmt::skip]` is specified as `&["rustfmt".to_string(), "skip".to_string()]`. - fn get_attrs_by_path(&self, def_id: DefId, attr: &[Symbol]) -> Vec<Attribute>; + fn tool_attrs(&self, def_id: DefId, attr: &[Symbol]) -> Vec<Attribute>; - /// Get all attributes of a definition. - fn get_all_attrs(&self, def_id: DefId) -> Vec<Attribute>; + /// Get all tool attributes of a definition. + fn all_tool_attrs(&self, def_id: DefId) -> Vec<Attribute>; /// Returns printable, human readable form of `Span` fn span_to_string(&self, span: Span) -> String; |
