Skip to content

Build failing after update to Rust 1.47.0 #77789

Closed
@Tamschi

Description

@Tamschi

I have a build that works fine on Rust 1.46.0 but fails on 1.47.0.
(I didn't have this issue on any 1.46 version, but I only run CI for 1.46.0.)

To reproduce, you can run:

git clone https://github.com/Tamschi/taml.git -b misc/rustc-bug-report
cd taml
cargo build

(Apologies for the large sample code. I failed to narrow this down on my own.)

On 1.46.0, this and cargo test complete successfully.
On 1.47.0, I get errors of this form:

error: expected `,`
   --> src\parsing.rs:541:12
    |
541 |                       Token {
    |  ___________________________^
542 | |                         span: _1,
543 | |                         token: lexerToken::Identifier(_0),
544 | |                     } = iter.next().unwrap()
    | |_____________________^
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Context

	loop {
		match iter.peek().map(|t| &t.token) {
			None => break,
			Some(lexerToken::Identifier(_)) => {
				let (key, key_span) = try_match!(
					Token {
						span: _1,
						token: lexerToken::Identifier(_0),
					} = iter.next().unwrap()
				)
				.debugless_unwrap();
				base.push(BasicPathElement {

Meta

The issue also appears on beta and nightly (and also on Linux, judging by the Travis run).

rustc --version --verbose:

  • stable:
    rustc 1.47.0 (18bf6b4f0 2020-10-07)
    binary: rustc
    commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
    commit-date: 2020-10-07
    host: x86_64-pc-windows-msvc
    release: 1.47.0
    LLVM version: 11.0
    
  • beta:
    rustc 1.48.0-beta.2 (212e76c31 2020-10-08)
    binary: rustc
    commit-hash: 212e76c31d461462544b5d516d3bdc99fc8f016e
    commit-date: 2020-10-08
    host: x86_64-pc-windows-msvc
    release: 1.48.0-beta.2
    LLVM version: 11.0
    
  • nightly:
    rustc 1.49.0-nightly (38d911dfc 2020-10-09)
    binary: rustc
    commit-hash: 38d911dfc55a7a1eea1c80139113ed2ff0151087
    commit-date: 2020-10-09
    host: x86_64-pc-windows-msvc
    release: 1.49.0-nightly
    LLVM version: 11.0
    
Macro Backtrace

RUSTFLAGS="-Z macro-backtrace" cargo +nightly build (excerpt):

   Compiling taml v0.0.3 (C:\Users\Tamme\Documents\Clones\taml)
error: expected `,`
   --> src\parsing.rs:541:12
    |
540 |                   let (key, key_span) = try_match!(
    |  _______________________________________-
541 | |                     Token {
    | |                           ^
542 | |                         span: _1,
543 | |                         token: lexerToken::Identifier(_0),
544 | |                     } = iter.next().unwrap()
545 | |                 )
    | |_________________- in this macro invocation (#1)
    |
   ::: C:\Users\Tamme\.cargo\registry\src\github.com-1ecc6299db9ec823\try_match-0.2.2\src\lib.rs:106:1
    |
106 | / macro_rules! try_match {
107 | |     ($p:pat = $in:expr => $out:expr) => {
108 | |         match $in {
109 | |             $p => ::core::result::Result::Ok($out),
...   |
120 | |         $crate::implicit_try_match!(($p) = $($in)*)
    | |         ------------------------------------------- in this macro invocation (#2)
121 | |     };
122 | | }
    | |_- in this expansion of `try_match!` (#1)
...
127 | / macro_rules! implicit_try_match {
128 | |     ($p:pat = $($in:tt)*) => {
129 | |         // `$p` needs to be parenthesized for it to work on nightly-2020-05-30
130 | |         // and syn 1.0.29
131 | |         $crate::implicit_try_match_inner!(std($p) = $($in)*)
    | |         ---------------------------------------------------- in this macro invocation (#3)
132 | |     };
133 | | }
    | |_- in this expansion of `$crate::implicit_try_match!` (#2)
...
170 |   #[proc_macro_hack::proc_macro_hack]
    |   -----------------------------------
    |   |
    |   in this expansion of `$crate::implicit_try_match_inner!` (#3)
    |  _in this macro invocation (#4)
    | |
171 | | #[doc(hidden)]
172 | | pub use try_match_inner::implicit_try_match_inner;
    | |_________________________________________________- in this expansion of `proc_macro_call!` (#4)
error: expected `,`
   --> src\parsing.rs:589:14
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-proc-macrosArea: Procedural macrosC-bugCategory: This is a bug.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions