Skip to content

Commit 92b837b

Browse files
author
The Miri Cronjob Bot
committed
Merge from rustc
2 parents b687053 + 789ee88 commit 92b837b

File tree

89 files changed

+1164
-961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+1164
-961
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,10 @@ pub enum ExprKind {
14541454
Block(P<Block>, Option<Label>),
14551455
/// An `async` block (`async move { ... }`),
14561456
/// or a `gen` block (`gen move { ... }`)
1457-
Gen(CaptureBy, P<Block>, GenBlockKind),
1457+
///
1458+
/// The span is the "decl", which is the header before the body `{ }`
1459+
/// including the `asyng`/`gen` keywords and possibly `move`.
1460+
Gen(CaptureBy, P<Block>, GenBlockKind, Span),
14581461
/// An await expression (`my_future.await`). Span is of await keyword.
14591462
Await(P<Expr>, Span),
14601463

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@ impl MetaItem {
327327
I: Iterator<Item = &'a TokenTree>,
328328
{
329329
// FIXME: Share code with `parse_path`.
330-
let path = match tokens.next().map(|tt| TokenTree::uninterpolate(tt)).as_deref() {
330+
let tt = tokens.next().map(|tt| TokenTree::uninterpolate(tt));
331+
let path = match tt.as_deref() {
331332
Some(&TokenTree::Token(
332333
Token { kind: ref kind @ (token::Ident(..) | token::PathSep), span },
333334
_,
@@ -368,6 +369,12 @@ impl MetaItem {
368369
token::Nonterminal::NtPath(path) => (**path).clone(),
369370
_ => return None,
370371
},
372+
Some(TokenTree::Token(
373+
Token { kind: token::OpenDelim(_) | token::CloseDelim(_), .. },
374+
_,
375+
)) => {
376+
panic!("Should be `AttrTokenTree::Delimited`, not delim tokens: {:?}", tt);
377+
}
371378
_ => return None,
372379
};
373380
let list_closing_paren_pos = tokens.peek().map(|tt| tt.span().hi());

0 commit comments

Comments
 (0)