]> git.lizzy.rs Git - rust.git/commitdiff
fix: backport changes for latest rustc api comaptibility
authorCaleb Cartwright <caleb.cartwright@outlook.com>
Sun, 2 May 2021 15:03:25 +0000 (10:03 -0500)
committerCaleb Cartwright <calebcartwright@users.noreply.github.com>
Sun, 2 May 2021 15:37:43 +0000 (10:37 -0500)
rust-toolchain
src/macros.rs
src/modules.rs

index c06f7353dfb0f2916d6fe93374e64cb165a90b49..d0654ca157bffa08b0833c1a57653339e0399ce3 100644 (file)
@@ -1,3 +1,3 @@
 [toolchain]
-channel = "nightly-2021-03-26"
+channel = "nightly-2021-05-01"
 components = ["rustc-dev"]
index 52534b216a65e2e12b12618e32cab89a5873e5f2..bf4769b34aa84a7554f5b0c4144626c64cc47c80 100644 (file)
@@ -13,7 +13,7 @@
 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};
@@ -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
@@ -1259,7 +1259,7 @@ fn parse_branch(&mut self) -> Option<MacroBranch> {
             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,
index ed4316974db2f65986595f55b870d18052a61104..c3f44068601359dadc6295de990d30abf134e210 100644 (file)
@@ -55,6 +55,7 @@ pub(crate) fn new(
 }
 
 impl<'a> AstLike for Module<'a> {
+    const SUPPORTS_CUSTOM_INNER_ATTRS: bool = true;
     fn attrs(&self) -> &[ast::Attribute] {
         &self.inner_attr
     }