Skip to content
New issue

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

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

Already on GitHub? # to your account

ICE: byte index 65 is not a char boundary #126764

Closed
matthiaskrgr opened this issue Jun 20, 2024 · 1 comment · Fixed by #126868
Closed

ICE: byte index 65 is not a char boundary #126764

matthiaskrgr opened this issue Jun 20, 2024 · 1 comment · Fixed by #126868
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

@matthiaskrgr
Copy link
Member

snippet:

struct PrintOnDrop<'a>(&'a str);

impl Drop for PrintOnDrop<'_> ;

Version information

rustc 1.81.0-nightly (cb8a7ea0e 2024-06-20)
binary: rustc
commit-hash: cb8a7ea0ed866295e0f65725cea6662bea51971a
commit-date: 2024-06-20
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{37e}
 --> /tmp/icemaker_global_tempdir.EweA4GFu25Ai/rustc_testrunner_tmpdir_reporting.8R2EphZwRLCc/mvce.rs:3:31
  |
3 | impl Drop for PrintOnDrop<'_> ;
  |                               ^
  |
help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
  |
3 | impl Drop for PrintOnDrop<'_> ;
  |                               ~

error: expected `{}`, found `;`
 --> /tmp/icemaker_global_tempdir.EweA4GFu25Ai/rustc_testrunner_tmpdir_reporting.8R2EphZwRLCc/mvce.rs:3:31
  |
3 | impl Drop for PrintOnDrop<'_> ;
  |                               ^
  |
  = help: try using `{}` instead

error[E0601]: `main` function not found in crate `mvce`
 --> /tmp/icemaker_global_tempdir.EweA4GFu25Ai/rustc_testrunner_tmpdir_reporting.8R2EphZwRLCc/mvce.rs:3:32
  |
3 | impl Drop for PrintOnDrop<'_> ;
  |                                ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.EweA4GFu25Ai/rustc_testrunner_tmpdir_reporting.8R2EphZwRLCc/mvce.rs`

thread 'rustc' panicked at compiler/rustc_span/src/source_map.rs:586:30:
byte index 65 is not a char boundary; it is inside ';' (bytes 64..66) of `struct PrintOnDrop<'a>(&'a str);

impl Drop for PrintOnDrop<'_> ;
`
stack backtrace:
   0:     0x7213106b1915 - std::backtrace_rs::backtrace::libunwind::trace::ha291fbfd64f8645d
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7213106b1915 - std::backtrace_rs::backtrace::trace_unsynchronized::h0f1ec8eeb4d23463
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7213106b1915 - std::sys::backtrace::_print_fmt::hde95b17c0b35e271
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/sys/backtrace.rs:68:5
   3:     0x7213106b1915 - <std::sys::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb324dbdfaad85d87
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/sys/backtrace.rs:44:22
   4:     0x7213107024bb - core::fmt::rt::Argument::fmt::h4bbc2216d032b29a
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/core/src/fmt/rt.rs:165:63
   5:     0x7213107024bb - core::fmt::write::h9ee4e80d5be5e082
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/core/src/fmt/mod.rs:1168:21
   6:     0x7213106a65af - std::io::Write::write_fmt::h515a3c4c2cfe4ae1
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/io/mod.rs:1835:15
   7:     0x7213106b16ee - std::sys::backtrace::_print::h8ca8e0bc45dc3b5d
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/sys/backtrace.rs:47:5
   8:     0x7213106b16ee - std::sys::backtrace::print::h35d37f27db6bbf35
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/sys/backtrace.rs:34:9
   9:     0x7213106b4129 - std::panicking::default_hook::{{closure}}::hf66091d321fde00e
  10:     0x7213106b3ecc - std::panicking::default_hook::hb8deb023bb3a58aa
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/panicking.rs:292:9
  11:     0x72130cd4f9e0 - std[3cb7c2e078c540c1]::panicking::update_hook::<alloc[da0decefddd6e90e]::boxed::Box<rustc_driver_impl[bfb76e7f0954192d]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7213106b4a4f - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h82ea3441e652cbf7
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/alloc/src/boxed.rs:2076:9
  13:     0x7213106b4a4f - std::panicking::rust_panic_with_hook::hf1ea2d67600dec3e
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/panicking.rs:804:13
  14:     0x7213106b4677 - std::panicking::begin_panic_handler::{{closure}}::h63afd2987ed6b2d8
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/panicking.rs:670:13
  15:     0x7213106b1dd9 - std::sys::backtrace::__rust_end_short_backtrace::h8eec498186c1f09a
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/sys/backtrace.rs:171:18
  16:     0x7213106b4304 - rust_begin_unwind
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/panicking.rs:661:5
  17:     0x7213106fea73 - core::panicking::panic_fmt::h03d6c687f9d9be4c
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/core/src/panicking.rs:74:14
  18:     0x721310706c8c - core::str::slice_error_fail_rt::h8540f067ae1f6181
  19:     0x72131070683a - core::str::slice_error_fail::hcffcb03b570a885e
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/core/src/str/mod.rs:89:5
  20:     0x72130fc8b391 - <rustc_span[9764bbb60ccaec40]::source_map::SourceMap>::indentation_before::{closure#0}.cold
  21:     0x72130f4368da - <rustc_span[9764bbb60ccaec40]::source_map::SourceMap>::indentation_before
  22:     0x72130aa2e4fb - rustc_hir_analysis[b5836596c5ecd536]::check::check::check_item_type
  23:     0x72130ba99f82 - rustc_hir_analysis[b5836596c5ecd536]::check::wfcheck::check_well_formed
  24:     0x72130e5cd569 - rustc_query_impl[fd48be434985ce3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fd48be434985ce3]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6dec774e880a165c]::query::erase::Erased<[u8; 1usize]>>
  25:     0x72130e5cd7ea - rustc_query_system[87c75860726f94c9]::query::plumbing::try_execute_query::<rustc_query_impl[fd48be434985ce3]::DynamicConfig<rustc_query_system[87c75860726f94c9]::query::caches::VecCache<rustc_hir[27eb3db17c85a5b3]::hir_id::OwnerId, rustc_middle[6dec774e880a165c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[fd48be434985ce3]::plumbing::QueryCtxt, false>
  26:     0x72130e5cd546 - rustc_query_impl[fd48be434985ce3]::query_impl::check_well_formed::get_query_non_incr::__rust_end_short_backtrace
  27:     0x72130e5ce2c1 - rustc_hir_analysis[b5836596c5ecd536]::check::wfcheck::check_mod_type_wf
  28:     0x72130e5ce107 - rustc_query_impl[fd48be434985ce3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fd48be434985ce3]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6dec774e880a165c]::query::erase::Erased<[u8; 1usize]>>
  29:     0x72130ecca0f0 - rustc_query_system[87c75860726f94c9]::query::plumbing::try_execute_query::<rustc_query_impl[fd48be434985ce3]::DynamicConfig<rustc_query_system[87c75860726f94c9]::query::caches::DefaultCache<rustc_span[9764bbb60ccaec40]::def_id::LocalModDefId, rustc_middle[6dec774e880a165c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[fd48be434985ce3]::plumbing::QueryCtxt, false>
  30:     0x72130ecc9e99 - rustc_query_impl[fd48be434985ce3]::query_impl::check_mod_type_wf::get_query_non_incr::__rust_end_short_backtrace
  31:     0x72130e5dffcc - rustc_hir_analysis[b5836596c5ecd536]::check_crate
  32:     0x72130e9e7087 - rustc_interface[723ef2a6affa26eb]::passes::analysis
  33:     0x72130e9e6bc7 - rustc_query_impl[fd48be434985ce3]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[fd48be434985ce3]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[6dec774e880a165c]::query::erase::Erased<[u8; 1usize]>>
  34:     0x72130f02c9e5 - rustc_query_system[87c75860726f94c9]::query::plumbing::try_execute_query::<rustc_query_impl[fd48be434985ce3]::DynamicConfig<rustc_query_system[87c75860726f94c9]::query::caches::SingleCache<rustc_middle[6dec774e880a165c]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[fd48be434985ce3]::plumbing::QueryCtxt, false>
  35:     0x72130f02c74f - rustc_query_impl[fd48be434985ce3]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36:     0x72130eee8752 - rustc_interface[723ef2a6affa26eb]::interface::run_compiler::<core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>, rustc_driver_impl[bfb76e7f0954192d]::run_compiler::{closure#0}>::{closure#1}
  37:     0x72130eea9949 - std[3cb7c2e078c540c1]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[723ef2a6affa26eb]::util::run_in_thread_with_globals<rustc_interface[723ef2a6affa26eb]::util::run_in_thread_pool_with_globals<rustc_interface[723ef2a6affa26eb]::interface::run_compiler<core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>, rustc_driver_impl[bfb76e7f0954192d]::run_compiler::{closure#0}>::{closure#1}, core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>>::{closure#0}, core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>>
  38:     0x72130eea9700 - <<std[3cb7c2e078c540c1]::thread::Builder>::spawn_unchecked_<rustc_interface[723ef2a6affa26eb]::util::run_in_thread_with_globals<rustc_interface[723ef2a6affa26eb]::util::run_in_thread_pool_with_globals<rustc_interface[723ef2a6affa26eb]::interface::run_compiler<core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>, rustc_driver_impl[bfb76e7f0954192d]::run_compiler::{closure#0}>::{closure#1}, core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>>::{closure#0}, core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d4d2cad7f3b970e8]::result::Result<(), rustc_span[9764bbb60ccaec40]::ErrorGuaranteed>>::{closure#2} as core[d4d2cad7f3b970e8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x7213106be8cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h539c158965a5e86f
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/alloc/src/boxed.rs:2062:9
  40:     0x7213106be8cb - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcc467bc1472c32d2
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/alloc/src/boxed.rs:2062:9
  41:     0x7213106be8cb - std::sys::pal::unix::thread::Thread::new::thread_start::h22273806a17d4b73
                               at /rustc/cb8a7ea0ed866295e0f65725cea6662bea51971a/library/std/src/sys/pal/unix/thread.rs:108:17
  42:     0x7213098a6ded - <unknown>
  43:     0x72130992a0dc - <unknown>
  44:                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 (cb8a7ea0e 2024-06-20) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_well_formed] checking that `<impl at /tmp/icemaker_global_tempdir.EweA4GFu25Ai/rustc_testrunner_tmpdir_reporting.8R2EphZwRLCc/mvce.rs:3:1: 3:30>` is well-formed
#1 [check_mod_type_wf] checking that types are well-formed in top-level module
end of query stack
error: aborting due to 3 previous errors

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

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Jun 20, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 20, 2024
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2022-12-18
commit[0] 2022-12-16: Auto merge of #105018 - zertosh:path_buf_deref_mut, r=dtolnay
commit[1] 2022-12-16: Auto merge of #102318 - Amanieu:default_alloc_error_handler, r=oli-obk
commit[2] 2022-12-17: Auto merge of #105804 - matthiaskrgr:rollup-iaqlbl3, r=matthiaskrgr
commit[3] 2022-12-17: Auto merge of #105811 - ojeda:Dwarnings-no_fp_fmt_parse, r=Mark-Simulacrum
commit[4] 2022-12-17: Auto merge of #105794 - ChrisDenton:internal-doc, r=jyn514
commit[5] 2022-12-17: Auto merge of #105820 - matthiaskrgr:rollup-uzm1l8f, r=matthiaskrgr
commit[6] 2022-12-17: Auto merge of #10094 - EricWu2003:increment-visitor-fix, r=xFrednet
commit[7] 2022-12-17: Auto merge of #105421 - jacobbramley:jb/branch-prot-check, r=nagisa
commit[8] 2022-12-17: Auto merge of #10096 - feniljain:fix-seek-rewind, r=xFrednet
commit[9] 2022-12-17: Auto merge of #10097 - flip1995:rustup, r=flip1995
commit[10] 2022-12-17: Auto merge of #105800 - lqd:dylib-thinlto, r=bjorn3
commit[11] 2022-12-17: Auto merge of #105827 - flip1995:clippyup, r=matthiaskrgr
commit[12] 2022-12-17: Auto merge of #105145 - Ayush1325:sequential-remote-server, r=Mark-Simulacrum

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 24, 2024
not use offset when there is not ends with brace

Fixes rust-lang#126764
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 24, 2024
not use offset when there is not ends with brace

Fixes rust-lang#126764
compiler-errors added a commit to compiler-errors/rust that referenced this issue Jun 25, 2024
not use offset when there is not ends with brace

Fixes rust-lang#126764
workingjubilee added a commit to workingjubilee/rustc that referenced this issue Jun 25, 2024
not use offset when there is not ends with brace

Fixes rust-lang#126764
@bors bors closed this as completed in 52e6f9c Jun 26, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 26, 2024
Rollup merge of rust-lang#126868 - bvanjoi:fix-126764, r=davidtwco

not use offset when there is not ends with brace

Fixes rust-lang#126764
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 26, 2024
# for free to join this conversation on GitHub. Already have an account? # 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

Successfully merging a pull request may close this issue.

3 participants