File tree Expand file tree Collapse file tree 2 files changed +7
-15
lines changed
compiler/rustc_attr_parsing/src Expand file tree Collapse file tree 2 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,8 @@ impl<'sess> AttributeParser<'sess> {
260260 // }
261261 ast:: AttrKind :: Normal ( n) => {
262262 let parser = MetaItemParser :: from_attr ( n, self . dcx ( ) ) ;
263- let ( path, args) = parser. deconstruct ( ) ;
263+ let path = parser. path_without_args ( ) ;
264+ let args = parser. args ( ) ;
264265 let parts = path. segments ( ) . map ( |i| i. name ) . collect :: < Vec < _ > > ( ) ;
265266
266267 if let Some ( accepts) = ATTRIBUTE_MAPPING . 0 . get ( parts. as_slice ( ) ) {
Original file line number Diff line number Diff line change @@ -253,7 +253,11 @@ impl<'a> MetaItemParser<'a> {
253253 }
254254 }
255255
256- /// Gets just the path, without the args.
256+ /// Gets just the path, without the args. Some examples:
257+ ///
258+ /// - `#[rustfmt::skip]`: `rustfmt::skip` is a path
259+ /// - `#[allow(clippy::complexity)]`: `clippy::complexity` is a path
260+ /// - `#[inline]`: `inline` is a single segment path
257261 pub fn path_without_args ( & self ) -> PathParser < ' a > {
258262 self . path . clone ( )
259263 }
@@ -263,19 +267,6 @@ impl<'a> MetaItemParser<'a> {
263267 & self . args
264268 }
265269
266- pub fn deconstruct ( & self ) -> ( PathParser < ' a > , & ArgParser < ' a > ) {
267- ( self . path_without_args ( ) , self . args ( ) )
268- }
269-
270- /// Asserts that this MetaItem starts with a path. Some examples:
271- ///
272- /// - `#[rustfmt::skip]`: `rustfmt::skip` is a path
273- /// - `#[allow(clippy::complexity)]`: `clippy::complexity` is a path
274- /// - `#[inline]`: `inline` is a single segment path
275- pub fn path ( & self ) -> ( PathParser < ' a > , & ArgParser < ' a > ) {
276- self . deconstruct ( )
277- }
278-
279270 /// Asserts that this MetaItem starts with a word, or single segment path.
280271 ///
281272 /// Some examples:
You can’t perform that action at this time.
0 commit comments