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

Error in raw string #104142

Closed
akis0 opened this issue Nov 8, 2022 · 2 comments · Fixed by #104193
Closed

Error in raw string #104142

akis0 opened this issue Nov 8, 2022 · 2 comments · Fixed by #104193
Assignees
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

@akis0
Copy link

akis0 commented Nov 8, 2022

Code

fn main() {
    println!(r#"
    \"\'}、"#);
}

Meta

rustc --version --verbose:

<version>
rustc 1.65.0 (897e37553 2022-11-02)

sorry in advance, i don't check if this issue is also in beta or nightly versions. i did.

Error output

<output>
❯ RUST_BACKTRACE=1 cargo run
   Compiling cat v0.1.0 (/mnt/c/Users/user/cats/cat)
thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1704:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
   1: core::panicking::panic_fmt
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
   2: core::panicking::panic
             at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:48:5
   3: <rustc_span::SourceFile>::lookup_file_pos
   4: <rustc_span::source_map::SourceMap>::lookup_char_pos
   5: <rustc_errors::emitter::EmitterWriter>::get_multispan_max_line_num
   6: <rustc_errors::emitter::EmitterWriter as rustc_errors::emitter::Emitter>::emit_diagnostic
   7: <rustc_errors::json::Diagnostic>::from_errors_diagnostic
   8: <rustc_errors::json::JsonEmitter as rustc_errors::emitter::Emitter>::emit_diagnostic
   9: <rustc_errors::HandlerInner>::emit_diagnostic
  10: <rustc_errors::Handler>::emit_diagnostic
  11: <rustc_errors::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  12: rustc_builtin_macros::format::expand_preparsed_format_args
  13: rustc_builtin_macros::format::expand_format_args_impl
  14: <rustc_expand::expand::MacroExpander>::fully_expand_fragment
  15: <rustc_expand::expand::MacroExpander>::expand_crate
  16: <rustc_session::session::Session>::time::<core::result::Result<rustc_ast::ast::Crate, rustc_errors::ErrorGuaranteed>, rustc_interface::passes::configure_and_expand::{closure#1}>
  17: rustc_interface::passes::configure_and_expand
  18: <rustc_interface::queries::Queries>::expansion
  19: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  20: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
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.65.0 (897e37553 2022-11-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `cat`
Backtrace

<backtrace>
❯ RUST_BACKTRACE=full cargo build
   Compiling cat v0.1.0 (/mnt/c/Users/user/cats/cat)
thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1704:17
stack backtrace:
   0:     0x7f86837e2d40 - std::backtrace_rs::backtrace::libunwind::trace::h32eb3e08e874dd27
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f86837e2d40 - std::backtrace_rs::backtrace::trace_unsynchronized::haa3f451d27bc11a5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f86837e2d40 - std::sys_common::backtrace::_print_fmt::h5b94a01bb4289bb5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f86837e2d40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb070b7fa7e3175df
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f868383dbfe - core::fmt::write::hd5207aebbb9a86e9
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f86837d3935 - std::io::Write::write_fmt::h3bd699bbd129ab8a
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/mod.rs:1679:15
   6:     0x7f86837e59f3 - std::sys_common::backtrace::_print::h7a21be552fdf58da
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f86837e59f3 - std::sys_common::backtrace::print::ha85c41fe4dd80b13
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f86837e59f3 - std::panicking::default_hook::{{closure}}::h04cca40023d0eeca
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:295:22
   9:     0x7f86837e56df - std::panicking::default_hook::haa3ca8c310ed5402
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:314:9
  10:     0x7f86860132e1 - rustc_driver[cfb34b1539811fe8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f86837e622d - std::panicking::rust_panic_with_hook::h7b190ce1a948faac
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:702:17
  12:     0x7f86837e6041 - std::panicking::begin_panic_handler::{{closure}}::hbafbfdc3e1b97f68
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:586:13
  13:     0x7f86837e31ec - std::sys_common::backtrace::__rust_end_short_backtrace::hda93e5fef243b4c0
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f86837e5da2 - rust_begin_unwind
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
  15:     0x7f868383a7d3 - core::panicking::panic_fmt::h8d17ca1073d9a733
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
  16:     0x7f868383a61d - core::panicking::panic::hf0565452d0d0936c
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:48:5
  17:     0x7f8685083e7d - <rustc_span[8f00505efff112e2]::SourceFile>::lookup_file_pos
  18:     0x7f8685083420 - <rustc_span[8f00505efff112e2]::source_map::SourceMap>::lookup_char_pos
  19:     0x7f8685d5ce19 - <rustc_errors[f77a66b68db622d5]::emitter::EmitterWriter>::get_multispan_max_line_num
  20:     0x7f8685d54719 - <rustc_errors[f77a66b68db622d5]::emitter::EmitterWriter as rustc_errors[f77a66b68db622d5]::emitter::Emitter>::emit_diagnostic
  21:     0x7f8685d50f51 - <rustc_errors[f77a66b68db622d5]::json::Diagnostic>::from_errors_diagnostic
  22:     0x7f8685d4f07e - <rustc_errors[f77a66b68db622d5]::json::JsonEmitter as rustc_errors[f77a66b68db622d5]::emitter::Emitter>::emit_diagnostic
  23:     0x7f8684a99c41 - <rustc_errors[f77a66b68db622d5]::HandlerInner>::emit_diagnostic
  24:     0x7f8684a99581 - <rustc_errors[f77a66b68db622d5]::Handler>::emit_diagnostic
  25:     0x7f868546655d - <rustc_errors[f77a66b68db622d5]::ErrorGuaranteed as rustc_errors[f77a66b68db622d5]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  26:     0x7f86857862d0 - rustc_builtin_macros[ed6672b6594e80a4]::format::expand_preparsed_format_args
  27:     0x7f868577f550 - rustc_builtin_macros[ed6672b6594e80a4]::format::expand_format_args_impl
  28:     0x7f86856be572 - <rustc_expand[e850aec5fc2c767b]::expand::MacroExpander>::fully_expand_fragment
  29:     0x7f8684f08ae3 - <rustc_expand[e850aec5fc2c767b]::expand::MacroExpander>::expand_crate
  30:     0x7f8684f07cf3 - <rustc_session[c5946fac61f8bc34]::session::Session>::time::<core[8c92e53db3fc2eaa]::result::Result<rustc_ast[86c44c57e50afb70]::ast::Crate, rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_interface[3182dd864eff9d7d]::passes::configure_and_expand::{closure#1}>
  31:     0x7f8684ecff23 - rustc_interface[3182dd864eff9d7d]::passes::configure_and_expand
  32:     0x7f8684ec6805 - <rustc_interface[3182dd864eff9d7d]::queries::Queries>::expansion
  33:     0x7f8684ec319c - rustc_interface[3182dd864eff9d7d]::interface::create_compiler_and_run::<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>
  34:     0x7f8684ec1ac1 - <scoped_tls[e395fa6e23b19669]::ScopedKey<rustc_span[8f00505efff112e2]::SessionGlobals>>::set::<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  35:     0x7f8684ec17af - std[71cb4861428b0c25]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  36:     0x7f8685e76d70 - <<std[71cb4861428b0c25]::thread::Builder>::spawn_unchecked_<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#1} as core[8c92e53db3fc2eaa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  37:     0x7f86837f0003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h49f797984e2121bf
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  38:     0x7f86837f0003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfa4f3d0ee6440e0b
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  39:     0x7f86837f0003 - std::sys::unix::thread::Thread::new::thread_start::h62ca48b42d48a8fc
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys/unix/thread.rs:108:17
  40:     0x7f86836bc609 - start_thread
  41:     0x7f86835df133 - clone
  42:                0x0 - <unknown>

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.65.0 (897e37553 2022-11-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `cat`

@akis0 akis0 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 Nov 8, 2022
@Rageking8
Copy link
Contributor

Repros on latest nightly and beta

@akis0
Copy link
Author

akis0 commented Nov 10, 2022

Repros on latest nightly and beta

I did on nightly and on beta. Both panicked but didn't cause internal compiler errors.

Nightly

Meta

rustc --version --verbose:

<version>
 `rustc 1.67.0-nightly (e75aab045 2022-11-09)`

Error output

<output>
   Compiling tr v0.1.0 (/home/stephan/rust1/tr)
thread '<unnamed>' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1700:17
stack backtrace:
   0:     0x7fab753f63e0 - std::backtrace_rs::backtrace::libunwind::trace::h475e6d14c20ac628
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fab753f63e0 - std::backtrace_rs::backtrace::trace_unsynchronized::h782386969d170809
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fab753f63e0 - std::sys_common::backtrace::_print_fmt::h2cff96f1339c9fb3
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fab753f63e0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h65381e912452bd50
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fab754584fe - core::fmt::write::hddf5212808edda8e
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/core/src/fmt/mod.rs:1209:17
   5:     0x7fab753e6555 - std::io::Write::write_fmt::h86ff774c1fbcc56f
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/io/mod.rs:1682:15
   6:     0x7fab753f61a5 - std::sys_common::backtrace::_print::hac5746116d4b1148
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fab753f61a5 - std::sys_common::backtrace::print::h989584698b4383b5
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fab753f8f7f - std::panicking::default_hook::{{closure}}::hdf7100a7f19aaac7
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:267:22
   9:     0x7fab753f8cba - std::panicking::default_hook::hd54c9e09261f65ab
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:286:9
  10:     0x7fab753f978c - std::panicking::rust_panic_with_hook::h6cb13ee30fd78212
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:688:13
  11:     0x7fab753f94e1 - std::panicking::begin_panic_handler::{{closure}}::h81e7b2a35760b48f
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:577:13
  12:     0x7fab753f688c - std::sys_common::backtrace::__rust_end_short_backtrace::h74bbf3f6d71875f1
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7fab753f9242 - rust_begin_unwind
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:575:5
  14:     0x7fab75454ee3 - core::panicking::panic_fmt::h89bd6f1292ecd482
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/core/src/panicking.rs:65:14
  15:     0x7fab75454fbd - core::panicking::panic::h8621bfb166577b81
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/core/src/panicking.rs:115:5
  16:     0x7fab76e6bda8 - <rustc_span[2e77502f23847349]::source_map::SourceMap>::lookup_char_pos
  17:     0x7fab77c5e132 - <rustc_errors[2bcb93b13263f24b]::emitter::EmitterWriter>::get_multispan_max_line_num
  18:     0x7fab77c55ceb - <rustc_errors[2bcb93b13263f24b]::emitter::EmitterWriter as rustc_errors[2bcb93b13263f24b]::emitter::Emitter>::emit_diagnostic
  19:     0x7fab77c53b09 - <rustc_errors[2bcb93b13263f24b]::json::Diagnostic>::from_errors_diagnostic
  20:     0x7fab77c530bc - <rustc_errors[2bcb93b13263f24b]::json::JsonEmitter as rustc_errors[2bcb93b13263f24b]::emitter::Emitter>::emit_diagnostic
  21:     0x7fab768c9c0a - <rustc_errors[2bcb93b13263f24b]::HandlerInner>::emit_diagnostic
  22:     0x7fab77415091 - <rustc_errors[2bcb93b13263f24b]::Handler>::emit_diagnostic
  23:     0x7fab773d198d - <rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed as rustc_errors[2bcb93b13263f24b]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  24:     0x7fab779de51f - rustc_builtin_macros[27fc18700f4ab977]::format::make_format_args
  25:     0x7fab779d3829 - rustc_builtin_macros[27fc18700f4ab977]::format::expand_format_args_impl
  26:     0x7fab7704f985 - <rustc_expand[222b844153769ae4]::expand::MacroExpander>::fully_expand_fragment
  27:     0x7fab778ed2e7 - <rustc_expand[222b844153769ae4]::expand::MacroExpander>::expand_crate
  28:     0x7fab778ec053 - <rustc_session[6a0929c18a48d200]::session::Session>::time::<core[7d0df67402c3c815]::result::Result<rustc_ast[e734813f4b1203b7]::ast::Crate, rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_interface[2d69c3ee45228f8a]::passes::configure_and_expand::{closure#1}>
  29:     0x7fab778b3086 - rustc_interface[2d69c3ee45228f8a]::passes::configure_and_expand
  30:     0x7fab778ab934 - <rustc_interface[2d69c3ee45228f8a]::queries::Queries>::expansion
  31:     0x7fab778a927c - <rustc_interface[2d69c3ee45228f8a]::interface::Compiler>::enter::<rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}::{closure#2}, core[7d0df67402c3c815]::result::Result<core[7d0df67402c3c815]::option::Option<rustc_interface[2d69c3ee45228f8a]::queries::Linker>, rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>
  32:     0x7fab778a43c2 - rustc_span[2e77502f23847349]::with_source_map::<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  33:     0x7fab778a3e9c - <scoped_tls[5e9cb458eb9b4943]::ScopedKey<rustc_span[2e77502f23847349]::SessionGlobals>>::set::<rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>
  34:     0x7fab778a3488 - std[15847fe8052079fc]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2d69c3ee45228f8a]::util::run_in_thread_pool_with_globals<rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>
  35:     0x7fab778a31ac - <<std[15847fe8052079fc]::thread::Builder>::spawn_unchecked_<rustc_interface[2d69c3ee45228f8a]::util::run_in_thread_pool_with_globals<rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>::{closure#1} as core[7d0df67402c3c815]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7fab79343953 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9a068bdd0d9f070e
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/alloc/src/boxed.rs:2000:9
  37:     0x7fab79343953 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h86d7b043c0b02a10
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/alloc/src/boxed.rs:2000:9
  38:     0x7fab79343953 - std::sys::unix::thread::Thread::new::thread_start::hfaaa856b3ec2dce6
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7fab752bc609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  40:     0x7fab751df133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  41:                0x0 - <unknown>
error: could not compile `tr`


Backtrace

<backtrace>
❯ RUST_BACKTRACE=full cargo build
   Compiling tr v0.1.0 (/home/stephan/rust1/tr)
thread '<unnamed>' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1700:17
stack backtrace:
   0:     0x7faafb65c3e0 - std::backtrace_rs::backtrace::libunwind::trace::h475e6d14c20ac628
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7faafb65c3e0 - std::backtrace_rs::backtrace::trace_unsynchronized::h782386969d170809
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7faafb65c3e0 - std::sys_common::backtrace::_print_fmt::h2cff96f1339c9fb3
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7faafb65c3e0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h65381e912452bd50
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7faafb6be4fe - core::fmt::write::hddf5212808edda8e
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/core/src/fmt/mod.rs:1209:17
   5:     0x7faafb64c555 - std::io::Write::write_fmt::h86ff774c1fbcc56f
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/io/mod.rs:1682:15
   6:     0x7faafb65c1a5 - std::sys_common::backtrace::_print::hac5746116d4b1148
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7faafb65c1a5 - std::sys_common::backtrace::print::h989584698b4383b5
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7faafb65ef7f - std::panicking::default_hook::{{closure}}::hdf7100a7f19aaac7
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:267:22
   9:     0x7faafb65ecba - std::panicking::default_hook::hd54c9e09261f65ab
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:286:9
  10:     0x7faafb65f78c - std::panicking::rust_panic_with_hook::h6cb13ee30fd78212
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:688:13
  11:     0x7faafb65f4e1 - std::panicking::begin_panic_handler::{{closure}}::h81e7b2a35760b48f
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:577:13
  12:     0x7faafb65c88c - std::sys_common::backtrace::__rust_end_short_backtrace::h74bbf3f6d71875f1
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7faafb65f242 - rust_begin_unwind
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/panicking.rs:575:5
  14:     0x7faafb6baee3 - core::panicking::panic_fmt::h89bd6f1292ecd482
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/core/src/panicking.rs:65:14
  15:     0x7faafb6bafbd - core::panicking::panic::h8621bfb166577b81
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/core/src/panicking.rs:115:5
  16:     0x7faafd0d1da8 - <rustc_span[2e77502f23847349]::source_map::SourceMap>::lookup_char_pos
  17:     0x7faafdec4132 - <rustc_errors[2bcb93b13263f24b]::emitter::EmitterWriter>::get_multispan_max_line_num
  18:     0x7faafdebbceb - <rustc_errors[2bcb93b13263f24b]::emitter::EmitterWriter as rustc_errors[2bcb93b13263f24b]::emitter::Emitter>::emit_diagnostic
  19:     0x7faafdeb9b09 - <rustc_errors[2bcb93b13263f24b]::json::Diagnostic>::from_errors_diagnostic
  20:     0x7faafdeb90bc - <rustc_errors[2bcb93b13263f24b]::json::JsonEmitter as rustc_errors[2bcb93b13263f24b]::emitter::Emitter>::emit_diagnostic
  21:     0x7faafcb2fc0a - <rustc_errors[2bcb93b13263f24b]::HandlerInner>::emit_diagnostic
  22:     0x7faafd67b091 - <rustc_errors[2bcb93b13263f24b]::Handler>::emit_diagnostic
  23:     0x7faafd63798d - <rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed as rustc_errors[2bcb93b13263f24b]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  24:     0x7faafdc4451f - rustc_builtin_macros[27fc18700f4ab977]::format::make_format_args
  25:     0x7faafdc39829 - rustc_builtin_macros[27fc18700f4ab977]::format::expand_format_args_impl
  26:     0x7faafd2b5985 - <rustc_expand[222b844153769ae4]::expand::MacroExpander>::fully_expand_fragment
  27:     0x7faafdb532e7 - <rustc_expand[222b844153769ae4]::expand::MacroExpander>::expand_crate
  28:     0x7faafdb52053 - <rustc_session[6a0929c18a48d200]::session::Session>::time::<core[7d0df67402c3c815]::result::Result<rustc_ast[e734813f4b1203b7]::ast::Crate, rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_interface[2d69c3ee45228f8a]::passes::configure_and_expand::{closure#1}>
  29:     0x7faafdb19086 - rustc_interface[2d69c3ee45228f8a]::passes::configure_and_expand
  30:     0x7faafdb11934 - <rustc_interface[2d69c3ee45228f8a]::queries::Queries>::expansion
  31:     0x7faafdb0f27c - <rustc_interface[2d69c3ee45228f8a]::interface::Compiler>::enter::<rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}::{closure#2}, core[7d0df67402c3c815]::result::Result<core[7d0df67402c3c815]::option::Option<rustc_interface[2d69c3ee45228f8a]::queries::Linker>, rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>
  32:     0x7faafdb0a3c2 - rustc_span[2e77502f23847349]::with_source_map::<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  33:     0x7faafdb09e9c - <scoped_tls[5e9cb458eb9b4943]::ScopedKey<rustc_span[2e77502f23847349]::SessionGlobals>>::set::<rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>
  34:     0x7faafdb09488 - std[15847fe8052079fc]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2d69c3ee45228f8a]::util::run_in_thread_pool_with_globals<rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>
  35:     0x7faafdb091ac - <<std[15847fe8052079fc]::thread::Builder>::spawn_unchecked_<rustc_interface[2d69c3ee45228f8a]::util::run_in_thread_pool_with_globals<rustc_interface[2d69c3ee45228f8a]::interface::run_compiler<core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>, rustc_driver[41f9f2ea3541ee7a]::run_compiler::{closure#1}>::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[7d0df67402c3c815]::result::Result<(), rustc_errors[2bcb93b13263f24b]::ErrorGuaranteed>>::{closure#1} as core[7d0df67402c3c815]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7faaff5a9953 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9a068bdd0d9f070e
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/alloc/src/boxed.rs:2000:9
  37:     0x7faaff5a9953 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h86d7b043c0b02a10
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/alloc/src/boxed.rs:2000:9
  38:     0x7faaff5a9953 - std::sys::unix::thread::Thread::new::thread_start::hfaaa856b3ec2dce6
                               at /rustc/e75aab045fc476f176a58c408f6b06f0e275c6e1/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7faafb522609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  40:     0x7faafb445133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  41:                0x0 - <unknown>
error: could not compile `tr`





Beta

Meta

rustc --version --verbose:

<version>
 rustc 1.66.0-beta.1 (e080cc5a6 2022-11-01)

Error output

<output>

  Compiling tr v0.1.0 (/home/stephan/rust1/tr)
thread '<unnamed>' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1700:17
stack backtrace:
   0:     0x7f27394759a0 - std::backtrace_rs::backtrace::libunwind::trace::h2df8645d586d9354
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f27394759a0 - std::backtrace_rs::backtrace::trace_unsynchronized::h8ccc7432adfc32a8
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f27394759a0 - std::sys_common::backtrace::_print_fmt::h6b5315b3e6c5b112
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f27394759a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1196a40d5ac35d56
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f27394d198e - core::fmt::write::hb5395aee3db34e90
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/fmt/mod.rs:1209:17
   5:     0x7f2739465c15 - std::io::Write::write_fmt::hf1b72fac8a3acb27
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/io/mod.rs:1682:15
   6:     0x7f2739475765 - std::sys_common::backtrace::_print::h805a3d8a840d4dd9
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f2739475765 - std::sys_common::backtrace::print::h9dc5789e99bcd646
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f273947856f - std::panicking::default_hook::{{closure}}::h79c2a100d70e0a69
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:267:22
   9:     0x7f27394782aa - std::panicking::default_hook::h9d54a6e2e183091b
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:286:9
  10:     0x7f2739478d78 - std::panicking::rust_panic_with_hook::h66c09c3756b56830
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:688:13
  11:     0x7f2739478ad1 - std::panicking::begin_panic_handler::{{closure}}::haacf5fe4954e1592
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:577:13
  12:     0x7f2739475e4c - std::sys_common::backtrace::__rust_end_short_backtrace::h3f18dbb82ab7bb81
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7f2739478832 - rust_begin_unwind
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:575:5
  14:     0x7f27394ce373 - core::panicking::panic_fmt::h44028ba00aff6a3b
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/panicking.rs:65:14
  15:     0x7f27394ce44d - core::panicking::panic::h071343d94407099c
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/panicking.rs:115:5
  16:     0x7f273ad262dd - <rustc_span[85bea1f81190796e]::source_map::SourceMap>::lookup_char_pos
  17:     0x7f273bc8f352 - <rustc_errors[8289f13c10dc8783]::emitter::EmitterWriter>::get_multispan_max_line_num
  18:     0x7f273bc86f18 - <rustc_errors[8289f13c10dc8783]::emitter::EmitterWriter as rustc_errors[8289f13c10dc8783]::emitter::Emitter>::emit_diagnostic
  19:     0x7f273bc84c11 - <rustc_errors[8289f13c10dc8783]::json::Diagnostic>::from_errors_diagnostic
  20:     0x7f273bc841bc - <rustc_errors[8289f13c10dc8783]::json::JsonEmitter as rustc_errors[8289f13c10dc8783]::emitter::Emitter>::emit_diagnostic
  21:     0x7f273b6bb28a - <rustc_errors[8289f13c10dc8783]::HandlerInner>::emit_diagnostic
  22:     0x7f273b6bac41 - <rustc_errors[8289f13c10dc8783]::Handler>::emit_diagnostic
  23:     0x7f273b676e8d - <rustc_errors[8289f13c10dc8783]::ErrorGuaranteed as rustc_errors[8289f13c10dc8783]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  24:     0x7f273b92a573 - rustc_builtin_macros[ad802a20e964a19a]::format::make_format_args
  25:     0x7f273b91f719 - rustc_builtin_macros[ad802a20e964a19a]::format::expand_format_args_impl
  26:     0x7f273b06b864 - <rustc_expand[16ea2ac5f3917bd2]::expand::MacroExpander>::fully_expand_fragment
  27:     0x7f273b9c87bd - <rustc_expand[16ea2ac5f3917bd2]::expand::MacroExpander>::expand_crate
  28:     0x7f273b9c7504 - <rustc_session[638750f383577479]::session::Session>::time::<core[6f75f940baff7b16]::result::Result<rustc_ast[3c7fc2053f8ae4a5]::ast::Crate, rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_interface[e10a04643064e0c3]::passes::configure_and_expand::{closure#1}>
  29:     0x7f273b98d986 - rustc_interface[e10a04643064e0c3]::passes::configure_and_expand
  30:     0x7f273b986154 - <rustc_interface[e10a04643064e0c3]::queries::Queries>::expansion
  31:     0x7f273b983a9c - <rustc_interface[e10a04643064e0c3]::interface::Compiler>::enter::<rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}::{closure#2}, core[6f75f940baff7b16]::result::Result<core[6f75f940baff7b16]::option::Option<rustc_interface[e10a04643064e0c3]::queries::Linker>, rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  32:     0x7f273b97b6f2 - rustc_span[85bea1f81190796e]::with_source_map::<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  33:     0x7f273b97b1e9 - <scoped_tls[df6a59750083ca9d]::ScopedKey<rustc_span[85bea1f81190796e]::SessionGlobals>>::set::<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  34:     0x7f273b97a7f8 - std[6a238fb43aa4c274]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e10a04643064e0c3]::util::run_in_thread_pool_with_globals<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  35:     0x7f273b97a51c - <<std[6a238fb43aa4c274]::thread::Builder>::spawn_unchecked_<rustc_interface[e10a04643064e0c3]::util::run_in_thread_pool_with_globals<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#1} as core[6f75f940baff7b16]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7f273d31dbc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h23aa6e7db304ed51
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:1987:9
  37:     0x7f273d31dbc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0482f1835c06f38d
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:1987:9
  38:     0x7f273d31dbc3 - std::sys::unix::thread::Thread::new::thread_start::h5213f0bce91e8f3e
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7f2739344609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  40:     0x7f2739267133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  41:                0x0 - <unknown>
error: could not compile `tr`

Backtrace

<backtrace>
❯ RUST_BACKTRACE=full cargo build
   Compiling tr v0.1.0 (/home/stephan/rust1/tr)
thread '<unnamed>' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1700:17
stack backtrace:
   0:     0x7ff3407d99a0 - std::backtrace_rs::backtrace::libunwind::trace::h2df8645d586d9354
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7ff3407d99a0 - std::backtrace_rs::backtrace::trace_unsynchronized::h8ccc7432adfc32a8
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7ff3407d99a0 - std::sys_common::backtrace::_print_fmt::h6b5315b3e6c5b112
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7ff3407d99a0 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1196a40d5ac35d56
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7ff34083598e - core::fmt::write::hb5395aee3db34e90
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/fmt/mod.rs:1209:17
   5:     0x7ff3407c9c15 - std::io::Write::write_fmt::hf1b72fac8a3acb27
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/io/mod.rs:1682:15
   6:     0x7ff3407d9765 - std::sys_common::backtrace::_print::h805a3d8a840d4dd9
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7ff3407d9765 - std::sys_common::backtrace::print::h9dc5789e99bcd646
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7ff3407dc56f - std::panicking::default_hook::{{closure}}::h79c2a100d70e0a69
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:267:22
   9:     0x7ff3407dc2aa - std::panicking::default_hook::h9d54a6e2e183091b
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:286:9
  10:     0x7ff3407dcd78 - std::panicking::rust_panic_with_hook::h66c09c3756b56830
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:688:13
  11:     0x7ff3407dcad1 - std::panicking::begin_panic_handler::{{closure}}::haacf5fe4954e1592
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:577:13
  12:     0x7ff3407d9e4c - std::sys_common::backtrace::__rust_end_short_backtrace::h3f18dbb82ab7bb81
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x7ff3407dc832 - rust_begin_unwind
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:575:5
  14:     0x7ff340832373 - core::panicking::panic_fmt::h44028ba00aff6a3b
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/panicking.rs:65:14
  15:     0x7ff34083244d - core::panicking::panic::h071343d94407099c
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/panicking.rs:115:5
  16:     0x7ff34208a2dd - <rustc_span[85bea1f81190796e]::source_map::SourceMap>::lookup_char_pos
  17:     0x7ff342ff3352 - <rustc_errors[8289f13c10dc8783]::emitter::EmitterWriter>::get_multispan_max_line_num
  18:     0x7ff342feaf18 - <rustc_errors[8289f13c10dc8783]::emitter::EmitterWriter as rustc_errors[8289f13c10dc8783]::emitter::Emitter>::emit_diagnostic
  19:     0x7ff342fe8c11 - <rustc_errors[8289f13c10dc8783]::json::Diagnostic>::from_errors_diagnostic
  20:     0x7ff342fe81bc - <rustc_errors[8289f13c10dc8783]::json::JsonEmitter as rustc_errors[8289f13c10dc8783]::emitter::Emitter>::emit_diagnostic
  21:     0x7ff342a1f28a - <rustc_errors[8289f13c10dc8783]::HandlerInner>::emit_diagnostic
  22:     0x7ff342a1ec41 - <rustc_errors[8289f13c10dc8783]::Handler>::emit_diagnostic
  23:     0x7ff3429dae8d - <rustc_errors[8289f13c10dc8783]::ErrorGuaranteed as rustc_errors[8289f13c10dc8783]::diagnostic_builder::EmissionGuarantee>::diagnostic_builder_emit_producing_guarantee
  24:     0x7ff342c8e573 - rustc_builtin_macros[ad802a20e964a19a]::format::make_format_args
  25:     0x7ff342c83719 - rustc_builtin_macros[ad802a20e964a19a]::format::expand_format_args_impl
  26:     0x7ff3423cf864 - <rustc_expand[16ea2ac5f3917bd2]::expand::MacroExpander>::fully_expand_fragment
  27:     0x7ff342d2c7bd - <rustc_expand[16ea2ac5f3917bd2]::expand::MacroExpander>::expand_crate
  28:     0x7ff342d2b504 - <rustc_session[638750f383577479]::session::Session>::time::<core[6f75f940baff7b16]::result::Result<rustc_ast[3c7fc2053f8ae4a5]::ast::Crate, rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_interface[e10a04643064e0c3]::passes::configure_and_expand::{closure#1}>
  29:     0x7ff342cf1986 - rustc_interface[e10a04643064e0c3]::passes::configure_and_expand
  30:     0x7ff342cea154 - <rustc_interface[e10a04643064e0c3]::queries::Queries>::expansion
  31:     0x7ff342ce7a9c - <rustc_interface[e10a04643064e0c3]::interface::Compiler>::enter::<rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}::{closure#2}, core[6f75f940baff7b16]::result::Result<core[6f75f940baff7b16]::option::Option<rustc_interface[e10a04643064e0c3]::queries::Linker>, rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  32:     0x7ff342cdf6f2 - rustc_span[85bea1f81190796e]::with_source_map::<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  33:     0x7ff342cdf1e9 - <scoped_tls[df6a59750083ca9d]::ScopedKey<rustc_span[85bea1f81190796e]::SessionGlobals>>::set::<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  34:     0x7ff342cde7f8 - std[6a238fb43aa4c274]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e10a04643064e0c3]::util::run_in_thread_pool_with_globals<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  35:     0x7ff342cde51c - <<std[6a238fb43aa4c274]::thread::Builder>::spawn_unchecked_<rustc_interface[e10a04643064e0c3]::util::run_in_thread_pool_with_globals<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#1} as core[6f75f940baff7b16]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  36:     0x7ff344681bc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h23aa6e7db304ed51
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:1987:9
  37:     0x7ff344681bc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0482f1835c06f38d
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:1987:9
  38:     0x7ff344681bc3 - std::sys::unix::thread::Thread::new::thread_start::h5213f0bce91e8f3e
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys/unix/thread.rs:108:17
  39:     0x7ff3406a8609 - start_thread
                               at /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477:8
  40:     0x7ff3405cb133 - clone
                               at /build/glibc-SzIz7B/glibc-2.31/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  41:                0x0 - <unknown>
error: could not compile `tr`

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2022
Shift no characters when using raw string literals

Fixes rust-lang#104142

Given the following code:

```rust
fn main() {
    println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#);
}
```

The current output is:

```
error: invalid format string: unmatched `}` found
 --> src/main.rs:2:59
  |
2 |     println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found
  |                                                           ^ unmatched `}` in format string
  |
  = note: if you intended to print `}`, you can escape it using `}}`

error: could not compile `debug_playground` due to previous error
```

The output should look like:

```
error: invalid format string: unmatched `}` found
 --> src/main.rs:2:45
  |
2 |     println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found
  |                                             ^ unmatched `}` in format string
  |
  = note: if you intended to print `}`, you can escape it using `}}`

error: could not compile `debug_playground` due to previous error
```

This pull request fixes the wrong span for `invalid format string` error and also solves the ICE.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Nov 16, 2022
Shift no characters when using raw string literals

Fixes rust-lang#104142

Given the following code:

```rust
fn main() {
    println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#);
}
```

The current output is:

```
error: invalid format string: unmatched `}` found
 --> src/main.rs:2:59
  |
2 |     println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found
  |                                                           ^ unmatched `}` in format string
  |
  = note: if you intended to print `}`, you can escape it using `}}`

error: could not compile `debug_playground` due to previous error
```

The output should look like:

```
error: invalid format string: unmatched `}` found
 --> src/main.rs:2:45
  |
2 |     println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found
  |                                             ^ unmatched `}` in format string
  |
  = note: if you intended to print `}`, you can escape it using `}}`

error: could not compile `debug_playground` due to previous error
```

This pull request fixes the wrong span for `invalid format string` error and also solves the ICE.
@bors bors closed this as completed in 88a1919 Nov 16, 2022
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

Successfully merging a pull request may close this issue.

3 participants