Skip to content

Commit

Permalink
fix: backport changes for latest rustc api comaptibility
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed May 2, 2021
1 parent ddb224a commit f874147
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2021-03-26"
channel = "nightly-2021-05-01"
components = ["rustc-dev"]
6 changes: 3 additions & 3 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::collections::HashMap;
use std::panic::{catch_unwind, AssertUnwindSafe};

use rustc_ast::token::{BinOpToken, DelimToken, Token, TokenKind};
use rustc_ast::tokenstream::{Cursor, LazyTokenStream, TokenStream, TokenTree};
use rustc_ast::tokenstream::{Cursor, Spacing, TokenStream, TokenTree};
use rustc_ast::{ast, ptr};
use rustc_ast_pretty::pprust;
use rustc_parse::parser::{ForceCollect, Parser};
Expand Down Expand Up @@ -1212,7 +1212,7 @@ pub(crate) fn convert_try_mac(
kind: ast::ExprKind::Try(parser.parse_expr().ok()?),
span: mac.span(), // incorrect span, but shouldn't matter too much
attrs: ast::AttrVec::new(),
tokens: Some(LazyTokenStream::new(ts)),
tokens: None,
})
} else {
None
Expand Down Expand Up @@ -1259,7 +1259,7 @@ impl MacroParser {
TokenTree::Token(..) => return None,
TokenTree::Delimited(delimited_span, d, _) => (delimited_span.open.lo(), d),
};
let args = tok.joint();
let args = TokenStream::new(vec![(tok, Spacing::Joint)]);
match self.toks.next()? {
TokenTree::Token(Token {
kind: TokenKind::FatArrow,
Expand Down
1 change: 1 addition & 0 deletions src/modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl<'a> Module<'a> {
}

impl<'a> AstLike for Module<'a> {
const SUPPORTS_CUSTOM_INNER_ATTRS: bool = true;
fn attrs(&self) -> &[ast::Attribute] {
&self.inner_attr
}
Expand Down

0 comments on commit f874147

Please sign in to comment.