Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread 'rustc' panicked at 'expected exactly one expression' #81815

Closed
ZhangZhuoSJTU opened this issue Feb 6, 2021 · 2 comments
Closed

Thread 'rustc' panicked at 'expected exactly one expression' #81815

ZhangZhuoSJTU opened this issue Feb 6, 2021 · 2 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ZhangZhuoSJTU
Copy link

Code

#[e]fn e<>(){0=#[test]0

md5 of poc.rs: c06a315316d866befd0e986395948a9b

Meta

This bug is tested with nightly, beta, and stable versions.

rustc --version --verbose:

➜  playground rustc --version --verbose
rustc 1.51.0-nightly (23adf9fd8 2021-02-05)
binary: rustc
commit-hash: 23adf9fd843da7a3394c824b056f93151aaa40ad
commit-date: 2021-02-05
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1

rustc 1.50.0-beta.8 (1cd030396 2021-01-20)
binary: rustc
commit-hash: 1cd0303963629f317a08e7e52162ccca7232ae7f
commit-date: 2021-01-20
host: x86_64-unknown-linux-gnu
release: 1.50.0-beta.8

rustc 1.49.0 (e1884a8e3 2020-12-29)
binary: rustc
commit-hash: e1884a8e3c3e813aada8254edfa120e85bf5ffca
commit-date: 2020-12-29
host: x86_64-unknown-linux-gnu
release: 1.49.0

Error output

This output is from nightly version

➜  playground rustc poc.rs
error: this file contains an unclosed delimiter
 --> out.rs:1:25
  |
1 | #[e]fn e<>(){0=#[test]0
  |             -           ^
  |             |
  |             unclosed delimiter

error[E0658]: attributes on expressions are experimental
 --> out.rs:1:16
  |
1 | #[e]fn e<>(){0=#[test]0
  |                ^^^^^^^
  |
  = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
  = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable

thread 'rustc' panicked at 'expected exactly one expression', compiler/rustc_expand/src/expand.rs:277:30
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.51.0-nightly (23adf9fd8 2021-02-05) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.
Backtrace

➜  playground RURUST_BACKTRACE=1 rustc poc.rs
error: this file contains an unclosed delimiter
 --> out.rs:1:25
  |
1 | #[e]fn e<>(){0=#[test]0
  |             -           ^
  |             |
  |             unclosed delimiter

error[E0658]: attributes on expressions are experimental
 --> out.rs:1:16
  |
1 | #[e]fn e<>(){0=#[test]0
  |                ^^^^^^^
  |
  = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
  = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable

thread 'rustc' panicked at 'expected exactly one expression', compiler/rustc_expand/src/expand.rs:277:30
stack backtrace:
   0: rust_begin_unwind
             at /rustc/23adf9fd843da7a3394c824b056f93151aaa40ad/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/23adf9fd843da7a3394c824b056f93151aaa40ad/library/core/src/panicking.rs:92:14
   2: core::option::expect_failed
             at /rustc/23adf9fd843da7a3394c824b056f93151aaa40ad/library/core/src/option.rs:1292:5
   3: rustc_expand::expand::AstFragmentKind::expect_from_annotatables
   4: rustc_expand::expand::MacroExpander::fully_expand_fragment
   5: rustc_expand::expand::MacroExpander::expand_crate
   6: rustc_session::utils::<impl rustc_session::session::Session>::time
   7: rustc_interface::passes::configure_and_expand_inner
   8: rustc_interface::passes::configure_and_expand::{{closure}}
   9: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
  10: rustc_interface::passes::configure_and_expand
  11: rustc_interface::queries::Queries::expansion
  12: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  13: rustc_span::with_source_map
  14: rustc_interface::interface::create_compiler_and_run
  15: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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.51.0-nightly (23adf9fd8 2021-02-05) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.

@ZhangZhuoSJTU ZhangZhuoSJTU added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 6, 2021
@osa1
Copy link
Contributor

osa1 commented Feb 6, 2021

Possibly a duplicate of #80251.

@petrochenkov
Copy link
Contributor

Closing as a duplicate of #80251.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants