Skip to content

ICE when invalid string literal used with macro #105011

Closed

Description

@jruderman

Code

fn main() {
    println!(""y);
}

Error output

Multiple ICEs reported including "TyKind::Error constructed but no error reported" and "broken MIR"

Full output

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_hir_typeck/src/expr.rs:358:39

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_hir_typeck/src/coercion.rs:172:49

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_hir_typeck/src/coercion.rs:1014:53

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_mir_build/src/build/mod.rs:637:18

error: internal compiler error: broken MIR in DefId(0:3 ~ att[35b6]::main) ("return type"): bad type [type error]
 --> att.rs:1:1
  |
1 | fn main() {
  | ^^^^^^^^^
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:520:13

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:768:20

error: internal compiler error: broken MIR in DefId(0:3 ~ att[35b6]::main) (LocalDecl { mutability: Mut, local_info: None, internal: false, is_block_tail: None, ty: [type error], user_ty: None, source_info: SourceInfo { span: att.rs:1:1: 1:10 (#0), scope: scope[0] } }): bad type [type error]
 --> att.rs:1:1
  |
1 | fn main() {
  | ^^^^^^^^^
  |
  = note: delayed at compiler/rustc_borrowck/src/type_check/mod.rs:520:13

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at /rustc/1eb62b1235fd77200e6bd967d70e83c0f2497233/compiler/rustc_middle/src/ty/relate.rs:425:59

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1609:13
stack backtrace:
   0:        0x10e9572a6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1901ec5c10c2d477
   1:        0x10e9b5e2a - core::fmt::write::h453ba3b763f16dfb
   2:        0x10e94964c - std::io::Write::write_fmt::h35935f9cf41659e0
   3:        0x10e95708a - std::sys_common::backtrace::print::h48cb2ddd4d16ad05
   4:        0x10e95a3d3 - std::panicking::default_hook::{{closure}}::hf85401495f021b7c
   5:        0x10e95a128 - std::panicking::default_hook::hcc698ed67aaec0db
   6:        0x118c0b5fd - rustc_driver[c6bc39476a4ff69]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x10e95abb7 - std::panicking::rust_panic_with_hook::h4686e220b4123e59
   8:        0x11d672a87 - std[e853a6d0ec043b70]::panicking::begin_panic::<rustc_errors[5974999511236221]::ExplicitBug>::{closure#0}
   9:        0x11d670e09 - std[e853a6d0ec043b70]::sys_common::backtrace::__rust_end_short_backtrace::<std[e853a6d0ec043b70]::panicking::begin_panic<rustc_errors[5974999511236221]::ExplicitBug>::{closure#0}, !>
  10:        0x11da93609 - std[e853a6d0ec043b70]::panicking::begin_panic::<rustc_errors[5974999511236221]::ExplicitBug>
  11:        0x11d662399 - std[e853a6d0ec043b70]::panic::panic_any::<rustc_errors[5974999511236221]::ExplicitBug>
  12:        0x11d669742 - <rustc_errors[5974999511236221]::HandlerInner>::flush_delayed::<alloc[374a688e4a400e73]::vec::Vec<rustc_errors[5974999511236221]::diagnostic::Diagnostic>, &str>
  13:        0x11d6683ac - <rustc_errors[5974999511236221]::Handler>::flush_delayed
  14:        0x118cd98d7 - <rustc_interface[6b0baa6f0acee236]::queries::Queries>::ongoing_codegen
  15:        0x118be3bb4 - <rustc_interface[6b0baa6f0acee236]::interface::Compiler>::enter::<rustc_driver[c6bc39476a4ff69]::run_compiler::{closure#1}::{closure#2}, core[e7c8723dd1d9fd02]::result::Result<core[e7c8723dd1d9fd02]::option::Option<rustc_interface[6b0baa6f0acee236]::queries::Linker>, rustc_errors[5974999511236221]::ErrorGuaranteed>>
  16:        0x118b7fd5d - rustc_span[db835ecaf6c42563]::with_source_map::<core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>, rustc_interface[6b0baa6f0acee236]::interface::run_compiler<core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>, rustc_driver[c6bc39476a4ff69]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  17:        0x118bd6a9d - <scoped_tls[9dceb67bf45baec5]::ScopedKey<rustc_span[db835ecaf6c42563]::SessionGlobals>>::set::<rustc_interface[6b0baa6f0acee236]::interface::run_compiler<core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>, rustc_driver[c6bc39476a4ff69]::run_compiler::{closure#1}>::{closure#0}, core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>>
  18:        0x118ba5ffa - std[e853a6d0ec043b70]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6b0baa6f0acee236]::util::run_in_thread_pool_with_globals<rustc_interface[6b0baa6f0acee236]::interface::run_compiler<core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>, rustc_driver[c6bc39476a4ff69]::run_compiler::{closure#1}>::{closure#0}, core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>>
  19:        0x118b862a5 - <<std[e853a6d0ec043b70]::thread::Builder>::spawn_unchecked_<rustc_interface[6b0baa6f0acee236]::util::run_in_thread_pool_with_globals<rustc_interface[6b0baa6f0acee236]::interface::run_compiler<core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>, rustc_driver[c6bc39476a4ff69]::run_compiler::{closure#1}>::{closure#0}, core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[e7c8723dd1d9fd02]::result::Result<(), rustc_errors[5974999511236221]::ErrorGuaranteed>>::{closure#1} as core[e7c8723dd1d9fd02]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  20:        0x10e963e87 - std::sys::unix::thread::Thread::new::thread_start::hb253bfeab5e611e1
  21:     0x7ff807a764e1 - __pthread_start

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.67.0-nightly (1eb62b123 2022-11-27) running on x86_64-apple-darwin

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

Regression

Regression in nightly-2022-11-18 from bebd57a (#102944, @nnethercote)

Version

rustc 1.67.0-nightly (1eb62b123 2022-11-27)
binary: rustc
commit-hash: 1eb62b1235fd77200e6bd967d70e83c0f2497233
commit-date: 2022-11-27
host: x86_64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

Activity

  1. added
    C-bugCategory: This is a bug.
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Nov 28, 2022
  2. TaKO8Ki commented on Nov 29, 2022

    @TaKO8Ki
    Member

    Regression in #102944

  3. self-assigned this
    on Nov 29, 2022
  4. added a commit that references this issue on Dec 1, 2022
    c181999
  5. added a commit that references this issue on Dec 1, 2022
    7a7b885
  6. added a commit that references this issue on Dec 1, 2022
    741f8c9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions