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> {
260
260
// }
261
261
ast:: AttrKind :: Normal ( n) => {
262
262
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 ( ) ;
264
265
let parts = path. segments ( ) . map ( |i| i. name ) . collect :: < Vec < _ > > ( ) ;
265
266
266
267
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> {
253
253
}
254
254
}
255
255
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
257
261
pub fn path_without_args ( & self ) -> PathParser < ' a > {
258
262
self . path . clone ( )
259
263
}
@@ -263,19 +267,6 @@ impl<'a> MetaItemParser<'a> {
263
267
& self . args
264
268
}
265
269
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
-
279
270
/// Asserts that this MetaItem starts with a word, or single segment path.
280
271
///
281
272
/// Some examples:
You can’t perform that action at this time.
0 commit comments