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

Multiline (more than 2 lines) inner attribute triggers ICE during doctest #97440

Closed
hafeoz opened this issue May 26, 2022 · 0 comments · Fixed by #97442
Closed

Multiline (more than 2 lines) inner attribute triggers ICE during doctest #97440

hafeoz opened this issue May 26, 2022 · 0 comments · Fixed by #97442
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

@hafeoz
Copy link
Contributor

hafeoz commented May 26, 2022

Following code produces triggers an ICE when running cargo test or cargo doctest:

Code

//! ```rust
//! #![deny(
//! unused_parens,
//! )]
//! ```

Open the code on playground

Meta

rustc --version --verbose:

rustc 1.63.0-nightly (4cbaac699 2022-05-25)
binary: rustc
commit-hash: 4cbaac699c14b7ac7cc80e54823b2ef6afeb64af
commit-date: 2022-05-25
host: x86_64-unknown-linux-gnu
release: 1.63.0-nightly
LLVM version: 14.0.4
Backtrace

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s


running 1 test
test src/lib.rs - (line 1) ... FAILED

failures:

---- src/lib.rs - (line 1) stdout ----
thread 'src/lib.rs - (line 1)' panicked at 'explicit panic', compiler/rustc_errors/src/diagnostic_builder.rs:553:21
stack backtrace:
   0:     0x7faf6fdc21cd - std::backtrace_rs::backtrace::libunwind::trace::h22893a5306c091b4
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7faf6fdc21cd - std::backtrace_rs::backtrace::trace_unsynchronized::h29c3bc6f9e91819d
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7faf6fdc21cd - std::sys_common::backtrace::_print_fmt::he497d8a0ec903793
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7faf6fdc21cd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c2a9d2774d81873
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7faf6fe1c01c - core::fmt::write::hba4337c43d992f49
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:1194:17
   5:     0x7faf6fdb3721 - std::io::Write::write_fmt::h78f748c5d5b1bfcf
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/io/mod.rs:1655:15
   6:     0x7faf6fdc52b5 - std::sys_common::backtrace::_print::h63c8b24acdd8e8ce
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7faf6fdc52b5 - std::sys_common::backtrace::print::h426700d6240cdcc2
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7faf6fdc52b5 - std::panicking::default_hook::{{closure}}::hc9a76eed0b18f82b
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:295:22
   9:     0x7faf6fdc4fa4 - std::panicking::default_hook::h2e88d02087fae196
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:311:9
  10:     0x7faf705421d1 - rustc_driver[413d55b6344850e3]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7faf6fdc5a00 - std::panicking::rust_panic_with_hook::habfdcc2e90f9fd4c
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:702:17
  12:     0x7faf6fdc57f9 - std::panicking::begin_panic_handler::{{closure}}::he054b2a83a51d2cd
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:586:13
  13:     0x7faf6fdc2684 - std::sys_common::backtrace::__rust_end_short_backtrace::ha48b94ab49b30915
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7faf6fdc5569 - rust_begin_unwind
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
  15:     0x7faf6fd896b3 - core::panicking::panic_fmt::h366d3a309ae17c94
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
  16:     0x7faf6fd8957d - core::panicking::panic::h8705e81f284be8a5
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:48:5
  17:     0x7faf723ccd8d - <rustc_errors[a7dbbf867eaca825]::diagnostic_builder::DiagnosticBuilderInner as core[a3420257622cd381]::ops::drop::Drop>::drop
  18:     0x55e94a7155ff - <scoped_tls[7ed3ce20ede545d8]::ScopedKey<rustc_span[7238ca7210ca999e]::SessionGlobals>>::with::<rustdoc[2368e8ab35c11ae8]::doctest::check_if_attr_is_complete::{closure#0}, bool>
  19:     0x55e94a869f5e - rustdoc[2368e8ab35c11ae8]::doctest::check_if_attr_is_complete
  20:     0x55e94a8685d5 - rustdoc[2368e8ab35c11ae8]::doctest::make_test
  21:     0x55e94a864fc8 - rustdoc[2368e8ab35c11ae8]::doctest::run_test::<<rustdoc[2368e8ab35c11ae8]::doctest::Collector as rustdoc[2368e8ab35c11ae8]::doctest::Tester>::add_test::{closure#2}::{closure#0}>
  22:     0x55e94a85e0eb - <<rustdoc[2368e8ab35c11ae8]::doctest::Collector as rustdoc[2368e8ab35c11ae8]::doctest::Tester>::add_test::{closure#2} as core[a3420257622cd381]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  23:     0x7faf73e4ffbe - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1c7ec42f80b6bbf5
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  24:     0x7faf73e4ffbe - test::__rust_begin_short_backtrace::h44156cd91cd40217
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/test/src/lib.rs:574:5
  25:     0x7faf73e4ed69 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1c7ec42f80b6bbf5
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  26:     0x7faf73e4ed69 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h3a32c43eeae577c5
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panic/unwind_safe.rs:271:9
  27:     0x7faf73e4ed69 - std::panicking::try::do_call::h5c8445fa1695dfc0
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:492:40
  28:     0x7faf73e4ed69 - std::panicking::try::h843e017f98c59921
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:456:19
  29:     0x7faf73e4ed69 - std::panic::catch_unwind::heae97ad77b9c2afb
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panic.rs:137:14
  30:     0x7faf73e4ed69 - test::run_test_in_process::h4f1c957830006b83
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/test/src/lib.rs:597:18
  31:     0x7faf73e4ed69 - test::run_test::run_test_inner::{{closure}}::hcf8ece35c4bf405a
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/test/src/lib.rs:491:39
  32:     0x7faf73e185de - test::run_test::run_test_inner::{{closure}}::hbf5ba8d7bc638131
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/test/src/lib.rs:518:37
  33:     0x7faf73e185de - std::sys_common::backtrace::__rust_begin_short_backtrace::he83971fb785dc493
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:122:18
  34:     0x7faf73e1ec68 - std::thread::Builder::spawn_unchecked_::{{closure}}::{{closure}}::h39e8bbdf36e3745e
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/thread/mod.rs:498:17
  35:     0x7faf73e1ec68 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h6ea411f1c52eb0ea
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panic/unwind_safe.rs:271:9
  36:     0x7faf73e1ec68 - std::panicking::try::do_call::h456700654b382ff0
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:492:40
  37:     0x7faf73e1ec68 - std::panicking::try::h08480bfb75b30726
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:456:19
  38:     0x7faf73e1ec68 - std::panic::catch_unwind::h6a5c99fdf51c894c
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panic.rs:137:14
  39:     0x7faf73e1ec68 - std::thread::Builder::spawn_unchecked_::{{closure}}::h786176e4c49e7123
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/thread/mod.rs:497:30
  40:     0x7faf73e1ec68 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h901bf2e14b264b26
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/ops/function.rs:227:5
  41:     0x7faf6fdcfbf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha99802c2c52ada61
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  42:     0x7faf6fdcfbf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha39aea1c57e28a15
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  43:     0x7faf6fdcfbf3 - std::sys::unix::thread::Thread::new::thread_start::h9f8e3d72b1f7662f
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys/unix/thread.rs:108:17
  44:     0x7faf6fd05609 - start_thread
  45:     0x7faf6faae133 - clone
  46:                0x0 - <unknown>

query stack during panic:
end of query stack


failures:
    src/lib.rs - (line 1)

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

@hafeoz hafeoz 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 May 26, 2022
@bors bors closed this as completed in 4614711 May 27, 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.

1 participant