Skip to content

panic: end byte index 2 is not a char boundary; it is inside '│' (bytes 1..4 of string) #22880

Closed

Description

@matthiaskrgr
---  
-│

~/.rustup/toolchains/master/bin/rust-analyzer highlight < code.rs

thread 'main' (3802873) panicked at /rustc/f65b272fc92b1e7527dea4a224430a249ab25c2d/library/core/src/str/mod.rs:861:21:
end byte index 2 is not a char boundary; it is inside '│' (bytes 1..4 of string)
stack backtrace:
   0:     0x7fcc9d01f986 - <<std[14b872c6dbd886e0]::sys::backtrace::BacktraceLock>::print::DisplayBacktrace as core[a6950792ababbd1]::fmt::Display>::fmt
   1:     0x7fcc9d60d908 - core[a6950792ababbd1]::fmt::write
   2:     0x7fcc9d034adc - <std[14b872c6dbd886e0]::sys::stdio::unix::Stderr as core[a6950792ababbd1]::io::write::Write>::write_fmt
   3:     0x7fcc9cff15ba - std[14b872c6dbd886e0]::panicking::default_hook::{closure#0}
   4:     0x7fcc9d012023 - std[14b872c6dbd886e0]::panicking::default_hook
   5:     0x7fcc9d01248b - std[14b872c6dbd886e0]::panicking::panic_with_hook
   6:     0x7fcc9cff1672 - std[14b872c6dbd886e0]::panicking::panic_handler::{closure#0}
   7:     0x7fcc9cfe8009 - std[14b872c6dbd886e0]::sys::backtrace::__rust_end_short_backtrace::<std[14b872c6dbd886e0]::panicking::panic_handler::{closure#0}, !>
   8:     0x7fcc9cff2fcd - __rustc[d223ed2f55e2e6b0]::rust_begin_unwind
   9:     0x7fcc99b9fd0c - core[a6950792ababbd1]::panicking::panic_fmt
  10:     0x7fcc9b92cce6 - core[a6950792ababbd1]::str::slice_error_fail_rt
  11:     0x7fcc9b6fa85a - core[a6950792ababbd1]::str::slice_error_fail
  12:     0x562cb1835789 - <parser[ccd1107d7cc37d92]::lexed_str::LexedStr>::new
  13:     0x562cb1eac4e3 - <syntax[63e6c74ee414afff]::ast::generated::nodes::SourceFile>::parse
  14:     0x562cb073ab6b - <<base_db[66f615b11fef7037]::editioned_file_id::EditionedFileId>::parse::_::parse_Configuration_ as salsa[dc22b664093bf419]::function::Configuration>::execute
  15:     0x562cb0729888 - <salsa[dc22b664093bf419]::function::IngredientImpl<<base_db[66f615b11fef7037]::editioned_file_id::EditionedFileId>::parse::_::parse_Configuration_>>::execute
  16:     0x562cb072773b - <base_db[66f615b11fef7037]::editioned_file_id::EditionedFileId>::parse
  17:     0x562cb0b63f68 - <hir_expand[ab8d5b2a1253ee80]::HirFileId>::parse_or_expand
  18:     0x562cb0b4a94b - <salsa[dc22b664093bf419]::function::IngredientImpl<<hir_expand[ab8d5b2a1253ee80]::HirFileId>::ast_id_map::_::ast_id_map__Configuration_>>::execute
  19:     0x562cb0b37f36 - salsa[dc22b664093bf419]::attach::attach::<&span[fcf0c62aa1326cbf]::ast_id::AstIdMap, dyn base_db[66f615b11fef7037]::SourceDatabase, <hir_expand[ab8d5b2a1253ee80]::HirFileId>::ast_id_map::ast_id_map_::{closure#0}>::{closure#0}
  20:     0x562cb0a41c16 - <hir_def[30d489770fdeebee]::item_tree::_::file_item_tree_query_Configuration_ as salsa[dc22b664093bf419]::function::Configuration>::execute
  21:     0x562cb092903c - <salsa[dc22b664093bf419]::function::IngredientImpl<hir_def[30d489770fdeebee]::item_tree::_::file_item_tree_query_Configuration_>>::execute
  22:     0x562cb09f5b6e - hir_def[30d489770fdeebee]::item_tree::file_item_tree
  23:     0x562cb0a00834 - hir_def[30d489770fdeebee]::nameres::collector::collect_defs
  24:     0x562cb0a40448 - <hir_def[30d489770fdeebee]::nameres::_::crate_local_def_map_Configuration_ as salsa[dc22b664093bf419]::function::Configuration>::execute
  25:     0x562cb0928605 - <salsa[dc22b664093bf419]::function::IngredientImpl<hir_def[30d489770fdeebee]::nameres::_::crate_local_def_map_Configuration_>>::execute
  26:     0x562cb09250e1 - <salsa[dc22b664093bf419]::function::IngredientImpl<hir_def[30d489770fdeebee]::nameres::_::crate_local_def_map_Configuration_>>::fetch
  27:     0x562cb0879101 - <salsa[dc22b664093bf419]::attach::Attached>::attach::<dyn base_db[66f615b11fef7037]::SourceDatabase, &hir_def[30d489770fdeebee]::nameres::DefMapPair, hir_def[30d489770fdeebee]::nameres::crate_local_def_map::{closure#0}>
  28:     0x562cb0832d57 - <hir[d93e9080096ec767]::semantics::source_to_def::SourceToDefCtx>::file_to_def
  29:     0x562cb080f8a4 - <hir[d93e9080096ec767]::semantics::SemanticsImpl>::file_to_module_defs
  30:     0x562cb081d1d6 - <hir[d93e9080096ec767]::semantics::SemanticsImpl>::attach_first_edition_opt
  31:     0x562cb11c405c - ide[f5854e1c26aef566]::syntax_highlighting::html::highlight_as_html_with_config
  32:     0x562cb112886c - <ide[f5854e1c26aef566]::Analysis>::highlight_as_html
  33:     0x562cb1bda182 - <rust_analyzer[47e7db669456c698]::cli::flags::Highlight>::run
  34:     0x562cb1e0e354 - rust_analyzer[e832f3322db99818]::main
  35:     0x562cb1e0a5c3 - std[14b872c6dbd886e0]::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core[a6950792ababbd1]::result::Result<std[14b872c6dbd886e0]::process::ExitCode, anyhow[3651e52fea1bebe0]::Error>, core[a6950792ababbd1]::result::Result<std[14b872c6dbd886e0]::process::ExitCode, anyhow[3651e52fea1bebe0]::Error>>
  36:     0x562cb1e0c322 - std[14b872c6dbd886e0]::rt::lang_start::<core[a6950792ababbd1]::result::Result<std[14b872c6dbd886e0]::process::ExitCode, anyhow[3651e52fea1bebe0]::Error>>::{closure#0}
  37:     0x7fcc9e8064dd - std[14b872c6dbd886e0]::rt::lang_start_internal
  38:     0x562cb1e24dc8 - main
  39:     0x7fcc97e27741 - <unknown>
  40:     0x7fcc97e27879 - __libc_start_main
  41:     0x562cb0708079 - <unknown>
  42:                0x0 - <unknown>

rust-analyzer 1.99.0-nightly (f65b272 2026-07-21)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions