File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -226,8 +226,16 @@ impl<'a> Parser<'a> {
226
226
if !parser. eat_keyword ( kw:: If ) {
227
227
return Err ( "Expected `if`" ) ;
228
228
}
229
+ // Inner attributes are not actually syntactically permitted here, but we don't
230
+ // care about inner vs outer attributes in this position. Our purpose with this
231
+ // special case parsing of cfg_if macros is to ensure we can correctly resolve
232
+ // imported modules that may have a custom `path` defined.
233
+ //
234
+ // As such, we just need to advance the parser past the attribute and up to
235
+ // to the opening brace.
236
+ // See also https://github.com/rust-lang/rust/pull/79433
229
237
parser
230
- . parse_attribute ( false )
238
+ . parse_attribute ( rustc_parse :: parser :: attr :: InnerAttrPolicy :: Permitted )
231
239
. map_err ( |_| "Failed to parse attributes" ) ?;
232
240
}
233
241
You can’t perform that action at this time.
0 commit comments