diff options
| author | Ralf Jung <post@ralfj.de> | 2025-01-01 19:09:01 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-01-15 09:41:33 +0100 |
| commit | cf0ab86251f1ab3e11132332695eee73ff746e27 (patch) | |
| tree | 6b9380ad1a5179aad154516d2b54d0bd3b9bb20f /compiler/rustc_ast/src | |
| parent | 561a097b653c53d264fb60b417ba07c19ee14f4a (diff) | |
| download | rust-cf0ab86251f1ab3e11132332695eee73ff746e27.tar.gz rust-cf0ab86251f1ab3e11132332695eee73ff746e27.zip | |
allowed_through_unstable_modules: support showing a deprecation message when the unstable module name is used
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/attr/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/attr/mod.rs b/compiler/rustc_ast/src/attr/mod.rs index 97385b2eaab..51f18580013 100644 --- a/compiler/rustc_ast/src/attr/mod.rs +++ b/compiler/rustc_ast/src/attr/mod.rs @@ -723,6 +723,8 @@ impl MetaItemLit { pub trait AttributeExt: Debug { fn id(&self) -> AttrId; + /// For a single-segment attribute (i.e., `#[attr]` and not `#[path::atrr]`), + /// return the name of the attribute, else return the empty identifier. fn name_or_empty(&self) -> Symbol { self.ident().unwrap_or_else(Ident::empty).name } |
