I haven't been able to minimize the full program yet, since it's hard to determine which of the symbols is actually causing the error, but the error comes from the parser so I removed all the other languages to make the generated file smaller. Check the repository for full source.
rustc 1.56.1 (59eed8a2a 2021-11-01)
binary: rustc
commit-hash: 59eed8a2aac0230a8b53e89d4e99d55912ba6b35
commit-date: 2021-11-01
host: x86_64-unknown-linux-gnu
release: 1.56.1
LLVM version: 13.0.0
error: expected one of `(`, `,`, `=`, `{`, or `}`, found `'n`
--> /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:31
|
12 | #[allow(missing_docs)] Cap'n Proto,
| ^^ expected one of `(`, `,`, `=`, `{`, or `}`
error: expected item, found `'n`
--> /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:31
|
12 | #[allow(missing_docs)] Cap'n Proto,
| ^^
thread 'rustc' panicked at 'Stack should be empty: final_buf=FrameData { open: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:11:23: 11:24 (#0), open_delim: Brace, inner: [(Token(Token { kind: Pound, span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:5: 12:6 (#0) }), Alone), (Delimited(DelimSpan { open: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:6: 12:7 (#0), close: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:26: 12:27 (#0) }, Bracket, AttrAnnotatedTokenStream([(Token(Token { kind: Ident("allow", false), span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:7: 12:12 (#0) }), Alone), (Delimited(DelimSpan { open: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:12: 12:13 (#0), close: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:25: 12:26 (#0) }, Paren, AttrAnnotatedTokenStream([(Token(Token { kind: Ident("missing_docs", false), span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:13: 12:25 (#0) }), Alone)])), Alone)])), Alone), (Token(Token { kind: Ident("Cap", false), span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:12:28: 12:31 (#0) }), Alone)] } stack=[FrameData { open: no-location (#0), open_delim: NoDelim, inner: [(Token(Token { kind: Ident("pub", false), span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:11:1: 11:4 (#0) }), Alone), (Token(Token { kind: Ident("enum", false), span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:11:5: 11:9 (#0) }), Alone), (Token(Token { kind: Ident("LanguageType", false), span: /home/michael/Downloads/tokei/target/debug/build/tokei-1c3ae2d72a936ed1/out/language_type.rs:11:10: 11:22 (#0) }), Alone)] }]', compiler/rustc_parse/src/parser/attr_wrapper.rs:501:5
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.56.1 (59eed8a2a 2021-11-01) running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
error: could not compile `tokei` due to 2 previous errors
I was trying to add Cap'n Proto to the list of languages that Tokei is able to recognize. I didn't realize that the build script took this list and generated rust code directly and blindly typed
"Cap'n Proto"as the language name, since that's what it is.The error seems to come from
attr_wrapper.rsfrom within the parser.Code
// Check https://git.sr.ht/~mzhang/rust-ice-tokei-quoteI haven't been able to minimize the full program yet, since it's hard to determine which of the symbols is actually causing the error, but the error comes from the parser so I removed all the other languages to make the generated file smaller. Check the repository for full source.
Meta
rustc --version --verbose:Error output
Backtrace