Open samlich opened 3 years ago
As a temporary workaround, you can add a comma between the two >
characters:
#[derive(Debug)]
struct S<#[cfg(feature = "alloc")] N: A<T>,> {}
Triage: This ICE still reproduces with latest nightly:
$ echo '#[derive(Debug)] struct S<#[cfg(feature = "alloc")] N: A<T>> {}' | rustc +nightly --crate-type lib -
thread 'rustc' panicked at compiler/rustc_parse/src/parser/attr_wrapper.rs:365:13:
Should not have unglued last token with cfg attr
...
$ rustc +nightly -vV
rustc 1.74.0-nightly (1e746d774 2023-09-07)
binary: rustc
commit-hash: 1e746d7741d44551e9378daf13b8797322aa0b74
commit-date: 2023-09-07
host: x86_64-unknown-linux-gnu
release: 1.74.0-nightly
LLVM version: 17.0.0
triage: yep, still broken
Code
Meta
rustc --version --verbose
:First fails in
rustc 1.53.0-nightly (a86612456 2021-04-11)
.Compiles successfully in
rustc 1.53.0-nightly (a836d9b64 2021-04-10)
.Perhaps related to #82608 which was merged on that date and appears when searching "unglued."
Error output
Backtrace
``` thread 'rustc' panicked at 'Should not have unglued last token with cfg attr', compiler/rustc_parse/src/parser/attr_wrapper.rs:371:13 stack backtrace: 0: std::panicking::begin_panic 1: rustc_parse::parser::generics::::parse_generic_params
2: rustc_parse::parser::generics::::parse_generics
3: rustc_parse::parser::item::::parse_item_kind
4: rustc_parse::parser::item::::parse_item_common
5: rustc_parse::parser::item::::parse_item
6: rustc_builtin_macros::cfg_eval::cfg_eval
7: ::expand
8: rustc_expand::expand::MacroExpander::fully_expand_fragment
9: rustc_expand::expand::MacroExpander::expand_crate
10: rustc_session::utils::::time
11: rustc_interface::passes::configure_and_expand
12: rustc_interface::queries::Queries::expansion
13: rustc_interface::queries::::enter
14: rustc_span::with_source_map
15: rustc_interface::interface::create_compiler_and_run
16: scoped_tls::ScopedKey::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```