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

ICE entered unreachable code: 'expr_to_string' ensures this is a string lit #114010

Closed
matthiaskrgr opened this issue Jul 24, 2023 · 1 comment · Fixed by #114014
Closed

ICE entered unreachable code: 'expr_to_string' ensures this is a string lit #114010

matthiaskrgr opened this issue Jul 24, 2023 · 1 comment · Fixed by #114014
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

@matthiaskrgr
Copy link
Member

Code

env![r#"oopsie"#];

Meta

rustc --version --verbose:

rustc 1.73.0-nightly (1d56e3a6d 2023-07-22)
binary: rustc
commit-hash: 1d56e3a6d943062e41165bf07fea5ea8324ae011
commit-date: 2023-07-22
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Error output


Backtrace

thread 'rustc' panicked at 'internal error: entered unreachable code: `expr_to_string` ensures this is a string lit', compiler/rustc_builtin_macros/src/env.rs:92:17
stack backtrace:
   0:     0x7f1ff8162fc1 - std::backtrace_rs::backtrace::libunwind::trace::h509905cddae686a6
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f1ff8162fc1 - std::backtrace_rs::backtrace::trace_unsynchronized::h6da0e2b3337b1e30
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f1ff8162fc1 - std::sys_common::backtrace::_print_fmt::h9216b13f5b8eb0d1
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f1ff8162fc1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4e00f1e93457531
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f1ff81c949c - core::fmt::rt::Argument::fmt::h5418ff3cd9c6d99d
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/fmt/rt.rs:138:9
   5:     0x7f1ff81c949c - core::fmt::write::h23a8d9337e11b079
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/fmt/mod.rs:1094:21
   6:     0x7f1ff81557ae - std::io::Write::write_fmt::hbe415f6b7f7a1912
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/io/mod.rs:1714:15
   7:     0x7f1ff8162dd5 - std::sys_common::backtrace::_print::hb9a6b5e7a19dcd5b
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f1ff8162dd5 - std::sys_common::backtrace::print::hfc5dc88d3a88062d
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f1ff8165e2a - std::panicking::panic_hook_with_disk_dump::{{closure}}::h51bf0a262f0cf563
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:278:22
  10:     0x7f1ff8165ac3 - std::panicking::panic_hook_with_disk_dump::h6c62bd88aa3ea831
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:312:9
  11:     0x7f1ffb381fd9 - <rustc_driver_impl[e9be562aef94a05d]::install_ice_hook::{closure#0} as core[10bad24bc919c215]::ops::function::FnOnce<(&core[10bad24bc919c215]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7f1ff81666d0 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hd745d583f4cb4971
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/alloc/src/boxed.rs:2021:9
  13:     0x7f1ff81666d0 - std::panicking::rust_panic_with_hook::hbda7e7161537b95d
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:733:13
  14:     0x7f1ff8166411 - std::panicking::begin_panic_handler::{{closure}}::hab2d8b6eac9548db
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:619:13
  15:     0x7f1ff8163426 - std::sys_common::backtrace::__rust_end_short_backtrace::he1caec0f4ddeb319
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys_common/backtrace.rs:151:18
  16:     0x7f1ff81661a2 - rust_begin_unwind
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/panicking.rs:617:5
  17:     0x7f1ff81c5853 - core::panicking::panic_fmt::h79f296680ee9d46c
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/core/src/panicking.rs:67:14
  18:     0x7f1ffabdd4a5 - rustc_builtin_macros[8f27ad8a4f049a87]::env::expand_env
  19:     0x7f1ffa03bd2b - <rustc_expand[6524ec723209282b]::expand::MacroExpander>::fully_expand_fragment
  20:     0x7f1ffa460467 - <rustc_expand[6524ec723209282b]::expand::MacroExpander>::expand_crate
  21:     0x7f1ffa45f73a - <rustc_session[9ddbf5ab1688fc16]::session::Session>::time::<rustc_ast[6084bf2dd6e0c532]::ast::Crate, rustc_interface[55063173ce956844]::passes::configure_and_expand::{closure#1}>
  22:     0x7f1ffa45507d - rustc_interface[55063173ce956844]::passes::resolver_for_lowering
  23:     0x7f1ffa87ac0a - rustc_query_impl[4d0ef3b00c5e4156]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[4d0ef3b00c5e4156]::query_impl::resolver_for_lowering::dynamic_query::{closure#2}::{closure#0}, rustc_middle[bead21bff5789310]::query::erase::Erased<[u8; 8usize]>>
  24:     0x7f1ffa87abf9 - <rustc_query_impl[4d0ef3b00c5e4156]::query_impl::resolver_for_lowering::dynamic_query::{closure#2} as core[10bad24bc919c215]::ops::function::FnOnce<(rustc_middle[bead21bff5789310]::ty::context::TyCtxt, ())>>::call_once
  25:     0x7f1ffa7edfac - rustc_query_system[1faf51cb8618f8cb]::query::plumbing::try_execute_query::<rustc_query_impl[4d0ef3b00c5e4156]::DynamicConfig<rustc_query_system[1faf51cb8618f8cb]::query::caches::SingleCache<rustc_middle[bead21bff5789310]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[4d0ef3b00c5e4156]::plumbing::QueryCtxt, false>
  26:     0x7f1fface04b5 - rustc_query_impl[4d0ef3b00c5e4156]::query_impl::resolver_for_lowering::get_query_non_incr::__rust_end_short_backtrace
  27:     0x7f1ffa5d4b43 - <rustc_middle[bead21bff5789310]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[e9be562aef94a05d]::run_compiler::{closure#1}::{closure#2}::{closure#2}, &rustc_data_structures[1cb6090e7ad35c2c]::steal::Steal<(rustc_middle[bead21bff5789310]::ty::ResolverAstLowering, alloc[742319f675282104]::rc::Rc<rustc_ast[6084bf2dd6e0c532]::ast::Crate>)>>
  28:     0x7f1ffa5d3f3a - <rustc_interface[55063173ce956844]::interface::Compiler>::enter::<rustc_driver_impl[e9be562aef94a05d]::run_compiler::{closure#1}::{closure#2}, core[10bad24bc919c215]::result::Result<core[10bad24bc919c215]::option::Option<rustc_interface[55063173ce956844]::queries::Linker>, rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>>
  29:     0x7f1ffa5d1204 - std[f09b4e9489d6fa37]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[55063173ce956844]::util::run_in_thread_pool_with_globals<rustc_interface[55063173ce956844]::interface::run_compiler<core[10bad24bc919c215]::result::Result<(), rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>, rustc_driver_impl[e9be562aef94a05d]::run_compiler::{closure#1}>::{closure#0}, core[10bad24bc919c215]::result::Result<(), rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[10bad24bc919c215]::result::Result<(), rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>>
  30:     0x7f1ffabf708e - <<std[f09b4e9489d6fa37]::thread::Builder>::spawn_unchecked_<rustc_interface[55063173ce956844]::util::run_in_thread_pool_with_globals<rustc_interface[55063173ce956844]::interface::run_compiler<core[10bad24bc919c215]::result::Result<(), rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>, rustc_driver_impl[e9be562aef94a05d]::run_compiler::{closure#1}>::{closure#0}, core[10bad24bc919c215]::result::Result<(), rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[10bad24bc919c215]::result::Result<(), rustc_span[453ac3b41b1db22e]::ErrorGuaranteed>>::{closure#1} as core[10bad24bc919c215]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  31:     0x7f1ff8170dc5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8a18b7b935b5e844
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/alloc/src/boxed.rs:2007:9
  32:     0x7f1ff8170dc5 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0b924a3cc5fe3c31
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/alloc/src/boxed.rs:2007:9
  33:     0x7f1ff8170dc5 - std::sys::unix::thread::Thread::new::thread_start::h58221aa77f2e8b9e
                               at /rustc/1d56e3a6d943062e41165bf07fea5ea8324ae011/library/std/src/sys/unix/thread.rs:108:17
  34:     0x7f1ff7ec944b - <unknown>
  35:     0x7f1ff7f4ce40 - <unknown>
  36:                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 attach the file at `/tmp/im/rustc-ice-2023-07-24T13:08:16.857562432Z-1809096.txt` to your bug report

query stack during panic:
#0 [resolver_for_lowering] getting the resolver for lowering
end of query stack

@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 Jul 24, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 24, 2023
@matthiaskrgr
Copy link
Member Author

Regression in nightly-2023-05-15
Regression in 0a0e045 #111552
Probably #111463 cc @clubby789

@davidtwco davidtwco self-assigned this Jul 24, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 25, 2023
@bors bors closed this as completed in 8ecaf2a Jul 25, 2023
flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 31, 2023
… r=cjgillot

builtin_macros: expect raw strings too

Fixes rust-lang#114010.

`expr_to_string` allows raw strings through so this code should be expected to handle those.
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.

4 participants