Skip to content

Thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1512:17 #81800

Closed
@ZhangZhuoSJTU

Description

@ZhangZhuoSJTU

I see an internal compiler error on following code.

Code

$ echo -n "ZW51bQBlbQDLgi0kVA==" | base64 -d > test.rs

$ md5sum test.rs
db9c062b3af7ab44afa653ecca2b3933  test.rs

$ rustc test.rs

Meta

I test it on stable, beta, and nightly version.

rustc --version --verbose:

rustc 1.51.0-nightly (4f4656d46 2021-02-04)
binary: rustc
commit-hash: 4f4656d46d84a488ae3df34b08f362d7071036a0
commit-date: 2021-02-04
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1

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

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

Error output

The output is from nightly.

error: unknown start of token: \u{0}
 --> test.rs:1:5
  |
1 | enumem˂-$T
  |     ^

error: unknown start of token: \u{0}
 --> test.rs:1:8
  |
1 | enumem˂-$T
  |       ^

error: unknown start of token: \u{2c2}
 --> test.rs:1:9
  |
1 | enumem˂-$T
  |       ^
  |
help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not
  |
1 | enumem<-$T
  |       ^

thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1512:17
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 (4f4656d46 2021-02-04) running on x86_64-unknown-linux-gnu

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

Backtrace

error: unknown start of token: \u{0}
 --> test.rs:1:5
  |
1 | enumem˂-$T
  |     ^

error: unknown start of token: \u{0}
 --> test.rs:1:8
  |
1 | enumem˂-$T
  |       ^

error: unknown start of token: \u{2c2}
 --> test.rs:1:9
  |
1 | enumem˂-$T
  |       ^
  |
help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not
  |
1 | enumem<-$T
  |       ^

thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1512:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/4f4656d46d84a488ae3df34b08f362d7071036a0/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/4f4656d46d84a488ae3df34b08f362d7071036a0/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/4f4656d46d84a488ae3df34b08f362d7071036a0/library/core/src/panicking.rs:50:5
   3: rustc_span::SourceFile::lookup_file_pos
   4: rustc_span::SourceFile::lookup_file_pos_with_col_display
   5: rustc_span::source_map::SourceMap::is_multiline
   6: rustc_parse::parser::diagnostics::<impl rustc_parse::parser::Parser>::expected_one_of_not_found
   7: rustc_parse::parser::generics::<impl rustc_parse::parser::Parser>::parse_generics
   8: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_common_
   9: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_common
  10: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_mod
  11: rustc_parse::parse_crate_from_file
  12: rustc_session::utils::<impl rustc_session::session::Session>::time
  13: rustc_interface::passes::parse
  14: rustc_interface::queries::Queries::parse
  15: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  16: rustc_span::with_source_map
  17: rustc_interface::interface::create_compiler_and_run
  18: 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 (4f4656d46 2021-02-04) running on x86_64-unknown-linux-gnu

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

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions