Skip to content

ICE: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32 #127823

Closed
@matthiaskrgr

Description

@matthiaskrgr

snippet:

const A: usize2; 

Version information

rustc 1.81.0-nightly (a91f7d72f 2024-07-16)
binary: rustc
commit-hash: a91f7d72f12efcc00ecf71591f066c534d45ddf7
commit-date: 2024-07-16
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error: unknown start of token: \u{2a75}
 --> /tmp/icemaker_global_tempdir.e46gMaSgxB9W/rustc_testrunner_tmpdir_reporting.ZkkxHf7ZZ25i/mvce.rs:1:16
  |
1 | const A: usize ⩵ 2; 
  |                ^
  |
help: Unicode character '⩵' (Two Consecutive Equals Signs) looks like '==' (Double Equals Sign), but it is not
  |
1 | const A: usize == 2; 
  |                ~~

error: unexpected `==`
 --> /tmp/icemaker_global_tempdir.e46gMaSgxB9W/rustc_testrunner_tmpdir_reporting.ZkkxHf7ZZ25i/mvce.rs:1:16
  |
1 | const A: usize ⩵ 2; 
  |                ^
  |
thread 'rustc' panicked at compiler/rustc_span/src/lib.rs:2097:17:
assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32
stack backtrace:
   0:     0x7c1cc09de3e5 - std::backtrace_rs::backtrace::libunwind::trace::hf161671508d91847
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7c1cc09de3e5 - std::backtrace_rs::backtrace::trace_unsynchronized::ha0d0b669fae1a811
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7c1cc09de3e5 - std::sys::backtrace::_print_fmt::h0aca386296ab9399
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/sys/backtrace.rs:65:5
   3:     0x7c1cc09de3e5 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hcd42b85197cbd4bf
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/sys/backtrace.rs:40:26
   4:     0x7c1cc0a2de1b - core::fmt::rt::Argument::fmt::hf236502f93c8e5ff
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/core/src/fmt/rt.rs:173:76
   5:     0x7c1cc0a2de1b - core::fmt::write::h9402866ea48d1483
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/core/src/fmt/mod.rs:1182:21
   6:     0x7c1cc09d2e9f - std::io::Write::write_fmt::h2c3d8e1efe7ea8ed
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/io/mod.rs:1827:15
   7:     0x7c1cc09e0bd1 - std::sys::backtrace::BacktraceLock::print::h0ad6c09d6cb14f3a
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/sys/backtrace.rs:43:9
   8:     0x7c1cc09e0bd1 - std::panicking::default_hook::{{closure}}::ha6830a71dd04e1d3
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/panicking.rs:269:22
   9:     0x7c1cc09e08ac - std::panicking::default_hook::hb2a8d12f4d199973
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/panicking.rs:296:9
  10:     0x7c1cbcde6eb9 - std[1bed36f9a066cc23]::panicking::update_hook::<alloc[1b688835cd2a2549]::boxed::Box<rustc_driver_impl[e130c54fc211eddf]::install_ice_hook::{closure#0}>>::{closure#0}
  11:     0x7c1cc09e159f - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hc820f5fd79138be0
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/alloc/src/boxed.rs:2084:9
  12:     0x7c1cc09e159f - std::panicking::rust_panic_with_hook::h53eadb333b03e88a
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/panicking.rs:808:13
  13:     0x7c1cc09e1193 - std::panicking::begin_panic_handler::{{closure}}::h00b6e00c8a1e50fb
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/panicking.rs:667:13
  14:     0x7c1cc09de8a9 - std::sys::backtrace::__rust_end_short_backtrace::h1b6119584a4140da
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/sys/backtrace.rs:168:18
  15:     0x7c1cc09e0e54 - rust_begin_unwind
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/panicking.rs:665:5
  16:     0x7c1cc0a2a3d3 - core::panicking::panic_fmt::h358ee3e3c9634fac
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/core/src/panicking.rs:74:14
  17:     0x7c1cc0a2a45c - core::panicking::panic::h3ae669dd273e0024
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/core/src/panicking.rs:148:5
  18:     0x7c1cbefd66e0 - <rustc_span[52a25f9bbeabff3d]::source_map::SourceMap>::lookup_char_pos
  19:     0x7c1cbf35d312 - <rustc_span[52a25f9bbeabff3d]::source_map::SourceMap>::is_valid_span
  20:     0x7c1cbf35b1a7 - <core[8f9ded7ca307af34]::iter::adapters::filter_map::FilterMap<core[8f9ded7ca307af34]::iter::adapters::cloned::Cloned<core[8f9ded7ca307af34]::iter::adapters::filter::Filter<core[8f9ded7ca307af34]::slice::iter::Iter<rustc_errors[f6c64b3ee2e0fa3b]::Substitution>, <rustc_errors[f6c64b3ee2e0fa3b]::CodeSuggestion>::splice_lines::{closure#0}>>, <rustc_errors[f6c64b3ee2e0fa3b]::CodeSuggestion>::splice_lines::{closure#1}> as core[8f9ded7ca307af34]::iter::traits::iterator::Iterator>::next
  21:     0x7c1cbf09891c - <rustc_errors[f6c64b3ee2e0fa3b]::emitter::HumanEmitter>::emit_messages_default
  22:     0x7c1cbf573fcf - <rustc_errors[f6c64b3ee2e0fa3b]::emitter::HumanEmitter as rustc_errors[f6c64b3ee2e0fa3b]::emitter::Emitter>::emit_diagnostic
  23:     0x7c1cbf572e89 - <rustc_errors[f6c64b3ee2e0fa3b]::DiagCtxtInner>::emit_diagnostic::{closure#3}
  24:     0x7c1cbf5716bc - rustc_interface[c56d2d1714ec79e6]::callbacks::track_diagnostic::<core[8f9ded7ca307af34]::option::Option<rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>
  25:     0x7c1cbf56fcbb - <rustc_errors[f6c64b3ee2e0fa3b]::DiagCtxtInner>::emit_diagnostic
  26:     0x7c1cbf56fb61 - <rustc_errors[f6c64b3ee2e0fa3b]::DiagCtxtHandle>::emit_diagnostic
  27:     0x7c1cbf56ed15 - <rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed as rustc_errors[f6c64b3ee2e0fa3b]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  28:     0x7c1cbf43ebab - <rustc_interface[c56d2d1714ec79e6]::queries::Queries>::parse
  29:     0x7c1cbf1c9946 - rustc_interface[c56d2d1714ec79e6]::interface::run_compiler::<core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>, rustc_driver_impl[e130c54fc211eddf]::run_compiler::{closure#0}>::{closure#1}
  30:     0x7c1cbf19edc9 - std[1bed36f9a066cc23]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[c56d2d1714ec79e6]::util::run_in_thread_with_globals<rustc_interface[c56d2d1714ec79e6]::util::run_in_thread_pool_with_globals<rustc_interface[c56d2d1714ec79e6]::interface::run_compiler<core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>, rustc_driver_impl[e130c54fc211eddf]::run_compiler::{closure#0}>::{closure#1}, core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>::{closure#0}, core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>
  31:     0x7c1cbf19eb7a - <<std[1bed36f9a066cc23]::thread::Builder>::spawn_unchecked_<rustc_interface[c56d2d1714ec79e6]::util::run_in_thread_with_globals<rustc_interface[c56d2d1714ec79e6]::util::run_in_thread_pool_with_globals<rustc_interface[c56d2d1714ec79e6]::interface::run_compiler<core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>, rustc_driver_impl[e130c54fc211eddf]::run_compiler::{closure#0}>::{closure#1}, core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>::{closure#0}, core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f9ded7ca307af34]::result::Result<(), rustc_span[52a25f9bbeabff3d]::ErrorGuaranteed>>::{closure#2} as core[8f9ded7ca307af34]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  32:     0x7c1cc09eb5fb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcc85614f472ca83b
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/alloc/src/boxed.rs:2070:9
  33:     0x7c1cc09eb5fb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb0e377a5e4dea4a7
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/alloc/src/boxed.rs:2070:9
  34:     0x7c1cc09eb5fb - std::sys::pal::unix::thread::Thread::new::thread_start::h31c873416e697604
                               at /rustc/a91f7d72f12efcc00ecf71591f066c534d45ddf7/library/std/src/sys/pal/unix/thread.rs:108:17
  35:     0x7c1cc077fded - <unknown>
  36:     0x7c1cc08030dc - <unknown>
  37:                0x0 - <unknown>

error: 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: please make sure that you have updated to the latest nightly

note: rustc 1.81.0-nightly (a91f7d72f 2024-07-16) running on x86_64-unknown-linux-gnu

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


Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an ASTA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-bugCategory: This is a bug.D-Unicode-unawareDiagnostics: Diagnostics that are unaware of Unicode and trigger codepoint boundary assertionsI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions