diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-20 12:08:00 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-05-21 04:53:31 +1000 |
| commit | ea3b3fdcc155fb0cd758392b68b1859cf9a435b4 (patch) | |
| tree | bde9a8efdc22799ee3dce0d9946bf55357945185 /compiler/rustc_attr_parsing/src/parser.rs | |
| parent | a822e557cd19efa0dcf62ae3e7af6b6310fa2f5c (diff) | |
| download | rust-ea3b3fdcc155fb0cd758392b68b1859cf9a435b4.tar.gz rust-ea3b3fdcc155fb0cd758392b68b1859cf9a435b4.zip | |
Remove `MetaItemParser::{word,word_without_args,path_is}`.
They are unused.
Diffstat (limited to 'compiler/rustc_attr_parsing/src/parser.rs')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/parser.rs | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/compiler/rustc_attr_parsing/src/parser.rs b/compiler/rustc_attr_parsing/src/parser.rs index a9eb0a51888..8366f163a68 100644 --- a/compiler/rustc_attr_parsing/src/parser.rs +++ b/compiler/rustc_attr_parsing/src/parser.rs @@ -277,37 +277,14 @@ impl<'a> MetaItemParser<'a> { } /// Asserts that this MetaItem starts with a word, or single segment path. - /// Doesn't return the args parser. - /// - /// For examples. see [`Self::word`] - pub fn word_without_args(&self) -> Option<Ident> { - Some(self.word()?.0) - } - - /// Asserts that this MetaItem starts with a word, or single segment path. /// /// Some examples: /// - `#[inline]`: `inline` is a word /// - `#[rustfmt::skip]`: `rustfmt::skip` is a path, /// and not a word and should instead be parsed using [`path`](Self::path) - pub fn word(&self) -> Option<(Ident, &ArgParser<'a>)> { - let (path, args) = self.deconstruct(); - Some((path.word()?, args)) - } - - /// Asserts that this MetaItem starts with some specific word. - /// - /// See [`word`](Self::word) for examples of what a word is. pub fn word_is(&self, sym: Symbol) -> Option<&ArgParser<'a>> { self.path_without_args().word_is(sym).then(|| self.args()) } - - /// Asserts that this MetaItem starts with some specific path. - /// - /// See [`word`](Self::path) for examples of what a word is. - pub fn path_is(&self, segments: &[Symbol]) -> Option<&ArgParser<'a>> { - self.path_without_args().segments_is(segments).then(|| self.args()) - } } #[derive(Clone)] |
