Skip to content

Commit f874147

Browse files
fix: backport changes for latest rustc api comaptibility
1 parent ddb224a commit f874147

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Diff for: rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2021-03-26"
2+
channel = "nightly-2021-05-01"
33
components = ["rustc-dev"]

Diff for: src/macros.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::collections::HashMap;
1313
use std::panic::{catch_unwind, AssertUnwindSafe};
1414

1515
use rustc_ast::token::{BinOpToken, DelimToken, Token, TokenKind};
16-
use rustc_ast::tokenstream::{Cursor, LazyTokenStream, TokenStream, TokenTree};
16+
use rustc_ast::tokenstream::{Cursor, Spacing, TokenStream, TokenTree};
1717
use rustc_ast::{ast, ptr};
1818
use rustc_ast_pretty::pprust;
1919
use rustc_parse::parser::{ForceCollect, Parser};
@@ -1212,7 +1212,7 @@ pub(crate) fn convert_try_mac(
12121212
kind: ast::ExprKind::Try(parser.parse_expr().ok()?),
12131213
span: mac.span(), // incorrect span, but shouldn't matter too much
12141214
attrs: ast::AttrVec::new(),
1215-
tokens: Some(LazyTokenStream::new(ts)),
1215+
tokens: None,
12161216
})
12171217
} else {
12181218
None
@@ -1259,7 +1259,7 @@ impl MacroParser {
12591259
TokenTree::Token(..) => return None,
12601260
TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
12611261
};
1262-
let args = tok.joint();
1262+
let args = TokenStream::new(vec![(tok, Spacing::Joint)]);
12631263
match self.toks.next()? {
12641264
TokenTree::Token(Token {
12651265
kind: TokenKind::FatArrow,

Diff for: src/modules.rs

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ impl<'a> Module<'a> {
5555
}
5656

5757
impl<'a> AstLike for Module<'a> {
58+
const SUPPORTS_CUSTOM_INNER_ATTRS: bool = true;
5859
fn attrs(&self) -> &[ast::Attribute] {
5960
&self.inner_attr
6061
}

0 commit comments

Comments
 (0)