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 on rustdoc test: delay span bug / thread::spawn failed: issue-80992.rs #8244

Open
matthiaskrgr opened this issue Jan 8, 2022 · 0 comments
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Jan 8, 2022

Summary

code from rustc ./src/test/rustdoc-ui/issue-80992.rs

pub fn test() -> Result<(), ()> {
    //! ```compile_fail
    //! fn test() -> Result< {}
    //! ```
    Ok(())
}

Found via #3142

Version

rustc 1.59.0-nightly (e012a191d 2022-01-06)
binary: rustc
commit-hash: e012a191d768adeda1ee36a99ef8b92d51920154
commit-date: 2022-01-06
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0

clippy 0.1.59 (e012a19 2022-01-06)

Error output

clippy-driver ./src/test/rustdoc-ui/issue-80992.rs --crate-type lib

Backtrace

warning: this returns a `Result<_, ()>`
--> ./src/test/rustdoc-ui/issue-80992.rs:1:1
|
1 | pub fn test() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::result_unit_err)]` on by default
= help: use a custom `Error` type instead
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err

thread '<unnamed>' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1188:13
stack backtrace:
 0:     0x7fe0510f1b4c - std::backtrace_rs::backtrace::libunwind::trace::hac89ae696ab31153
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
 1:     0x7fe0510f1b4c - std::backtrace_rs::backtrace::trace_unsynchronized::he0e34c1ffcd1fd95
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x7fe0510f1b4c - std::sys_common::backtrace::_print_fmt::hbbcd6534ff2cdaab
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:67:5
 3:     0x7fe0510f1b4c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hca373cbf95c63dfd
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:46:22
 4:     0x7fe05115268c - core::fmt::write::hf1bd4152e956a546
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/fmt/mod.rs:1168:17
 5:     0x7fe0510e0ec3 - std::io::Write::write_fmt::h2f14a980b941fea5
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/io/mod.rs:1660:15
 6:     0x7fe0510f6012 - std::sys_common::backtrace::_print::hc99e12058f69fd7f
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:49:5
 7:     0x7fe0510f6012 - std::sys_common::backtrace::print::h28ddbd216cc47c63
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:36:9
 8:     0x7fe0510f6012 - std::panicking::default_hook::{{closure}}::h91763e160bca83d2
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:211:50
 9:     0x7fe0510f5bf5 - std::panicking::default_hook::h04e711875c06f41e
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:228:9
10:     0x55cea4d1fa01 - clippy_driver[de939f5069ad0877]::ICE_HOOK::{closure#0}::{closure#0}
11:     0x7fe0510f67c5 - std::panicking::rust_panic_with_hook::h7d6693789c82cfe4
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:610:17
12:     0x7fe0510f64c0 - std::panicking::begin_panic_handler::{{closure}}::ha2fa99da9c892fdb
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:502:13
13:     0x7fe0510f1ff4 - std::sys_common::backtrace::__rust_end_short_backtrace::h6aa583a96333c408
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:139:18
14:     0x7fe0510f61f9 - rust_begin_unwind
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:498:5
15:     0x7fe0510bdec1 - core::panicking::panic_fmt::h5b13621b08c43b42
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/panicking.rs:107:14
16:     0x7fe052a1fa1c - core[24291291a921b533]::panicking::panic_display::<&str>
17:     0x7fe05409468d - <rustc_errors[62a5cc7b06393f71]::HandlerInner>::flush_delayed
18:     0x7fe054092b6d - <rustc_errors[62a5cc7b06393f71]::HandlerInner as core[24291291a921b533]::ops::drop::Drop>::drop
19:     0x55cea4e5c516 - core[24291291a921b533]::ptr::drop_in_place::<rustc_session[c20293ac279aad06]::parse::ParseSess>
20:     0x55cea4e608ab - <scoped_tls[ec1705c99dfa8720]::ScopedKey<rustc_span[5840c952fc6dfb1f]::SessionGlobals>>::set::<clippy_lints[3e536fcc5bfc7607]::doc::check_code::has_needless_main::{closure#0}::{closure#0}, bool>
21:     0x55cea4d371d8 - <core[24291291a921b533]::panic::unwind_safe::AssertUnwindSafe<clippy_lints[3e536fcc5bfc7607]::doc::check_code::has_needless_main::{closure#0}> as core[24291291a921b533]::ops::function::FnOnce<()>>::call_once
22:     0x55cea4d26af6 - rustc_driver[aab467f4c82ed6ad]::catch_fatal_errors::<clippy_lints[3e536fcc5bfc7607]::doc::check_code::has_needless_main::{closure#0}, bool>
23:     0x55cea4d376f0 - std[e740e8867e95a171]::sys_common::backtrace::__rust_begin_short_backtrace::<clippy_lints[3e536fcc5bfc7607]::doc::check_code::{closure#0}, bool>
24:     0x55cea4f4d68b - <<std[e740e8867e95a171]::thread::Builder>::spawn_unchecked<clippy_lints[3e536fcc5bfc7607]::doc::check_code::{closure#0}, bool>::{closure#1} as core[24291291a921b533]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
25:     0x7fe051101cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9a9713b5d2e24fc2
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/alloc/src/boxed.rs:1854:9
26:     0x7fe051101cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9651309876a3c2bf
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/alloc/src/boxed.rs:1854:9
27:     0x7fe051101cf3 - std::sys::unix::thread::Thread::new::thread_start::h8f346e0de1984669
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys/unix/thread.rs:108:17
28:     0x7fe050ff4259 - start_thread
29:     0x7fe050dd75e3 - __GI___clone
30:                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-clippy/issues/new

note: Clippy version: clippy 0.1.59 (e012a19 2022-01-06)

query stack during panic:
end of query stack
thread 'rustc' panicked at 'thread::spawn failed: Any { .. }', src/tools/clippy/clippy_lints/src/doc.rs:689:10
stack backtrace:
 0:     0x7fe0510f1b4c - std::backtrace_rs::backtrace::libunwind::trace::hac89ae696ab31153
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
 1:     0x7fe0510f1b4c - std::backtrace_rs::backtrace::trace_unsynchronized::he0e34c1ffcd1fd95
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
 2:     0x7fe0510f1b4c - std::sys_common::backtrace::_print_fmt::hbbcd6534ff2cdaab
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:67:5
 3:     0x7fe0510f1b4c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hca373cbf95c63dfd
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:46:22
 4:     0x7fe05115268c - core::fmt::write::hf1bd4152e956a546
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/fmt/mod.rs:1168:17
 5:     0x7fe0510e0ec3 - std::io::Write::write_fmt::h2f14a980b941fea5
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/io/mod.rs:1660:15
 6:     0x7fe0510f6012 - std::sys_common::backtrace::_print::hc99e12058f69fd7f
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:49:5
 7:     0x7fe0510f6012 - std::sys_common::backtrace::print::h28ddbd216cc47c63
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:36:9
 8:     0x7fe0510f6012 - std::panicking::default_hook::{{closure}}::h91763e160bca83d2
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:211:50
 9:     0x7fe0510f5bf5 - std::panicking::default_hook::h04e711875c06f41e
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:228:9
10:     0x55cea4d1fa01 - clippy_driver[de939f5069ad0877]::ICE_HOOK::{closure#0}::{closure#0}
11:     0x7fe0510f67c5 - std::panicking::rust_panic_with_hook::h7d6693789c82cfe4
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:610:17
12:     0x7fe0510f64c0 - std::panicking::begin_panic_handler::{{closure}}::ha2fa99da9c892fdb
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:502:13
13:     0x7fe0510f1ff4 - std::sys_common::backtrace::__rust_end_short_backtrace::h6aa583a96333c408
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys_common/backtrace.rs:139:18
14:     0x7fe0510f61f9 - rust_begin_unwind
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/panicking.rs:498:5
15:     0x7fe0510bdec1 - core::panicking::panic_fmt::h5b13621b08c43b42
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/panicking.rs:107:14
16:     0x7fe0510bdfb3 - core::result::unwrap_failed::h8401f67cbdc649e8
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/core/src/result.rs:1690:5
17:     0x55cea4f9de93 - clippy_lints[3e536fcc5bfc7607]::doc::check_attrs
18:     0x55cea4f99d2a - <clippy_lints[3e536fcc5bfc7607]::doc::DocMarkdown as rustc_lint[791f8e2cef40682b]::passes::LateLintPass>::check_item
19:     0x7fe0526d10a1 - <rustc_lint[791f8e2cef40682b]::late::LateLintPassObjects as rustc_lint[791f8e2cef40682b]::passes::LateLintPass>::check_item
20:     0x7fe0519d4cde - <rustc_lint[791f8e2cef40682b]::late::LateContextAndPass<rustc_lint[791f8e2cef40682b]::late::LateLintPassObjects> as rustc_hir[b6231e5dfc545669]::intravisit::Visitor>::visit_nested_item
21:     0x7fe051971bb7 - rustc_hir[b6231e5dfc545669]::intravisit::walk_mod::<rustc_lint[791f8e2cef40682b]::late::LateContextAndPass<rustc_lint[791f8e2cef40682b]::late::LateLintPassObjects>>
22:     0x7fe0519d63dc - <rustc_lint[791f8e2cef40682b]::late::LateContextAndPass<rustc_lint[791f8e2cef40682b]::late::LateLintPassObjects> as rustc_hir[b6231e5dfc545669]::intravisit::Visitor>::visit_mod
23:     0x7fe0519d6b04 - rustc_lint[791f8e2cef40682b]::late::late_lint_pass_crate::<rustc_lint[791f8e2cef40682b]::late::LateLintPassObjects>
24:     0x7fe052b516f7 - <rustc_session[c20293ac279aad06]::session::Session>::time::<(), rustc_lint[791f8e2cef40682b]::late::check_crate<rustc_lint[791f8e2cef40682b]::BuiltinCombinedLateLintPass, rustc_interface[947fac54d3fe2868]::passes::analysis::{closure#5}::{closure#0}::{closure#3}::{closure#0}::{closure#0}>::{closure#0}::{closure#0}>
25:     0x7fe0537baae6 - <core[24291291a921b533]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[947fac54d3fe2868]::passes::analysis::{closure#5}::{closure#0}::{closure#3}> as core[24291291a921b533]::ops::function::FnOnce<()>>::call_once
26:     0x7fe0537bc53e - <core[24291291a921b533]::panic::unwind_safe::AssertUnwindSafe<rustc_interface[947fac54d3fe2868]::passes::analysis::{closure#5}::{closure#0}> as core[24291291a921b533]::ops::function::FnOnce<()>>::call_once
27:     0x7fe0537b8948 - <rustc_session[c20293ac279aad06]::session::Session>::time::<(), rustc_interface[947fac54d3fe2868]::passes::analysis::{closure#5}>
28:     0x7fe053792ffc - rustc_interface[947fac54d3fe2868]::passes::analysis
29:     0x7fe053c37c05 - rustc_query_system[1b2734a6ce8acad3]::query::plumbing::try_execute_query::<rustc_query_impl[e097f5d713df899a]::plumbing::QueryCtxt, rustc_query_system[1b2734a6ce8acad3]::query::caches::DefaultCache<(), core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>>
30:     0x7fe053c90cf5 - rustc_query_system[1b2734a6ce8acad3]::query::plumbing::get_query::<rustc_query_impl[e097f5d713df899a]::queries::analysis, rustc_query_impl[e097f5d713df899a]::plumbing::QueryCtxt>
31:     0x7fe053773f30 - <rustc_interface[947fac54d3fe2868]::interface::Compiler>::enter::<rustc_driver[aab467f4c82ed6ad]::run_compiler::{closure#1}::{closure#2}, core[24291291a921b533]::result::Result<core[24291291a921b533]::option::Option<rustc_interface[947fac54d3fe2868]::queries::Linker>, rustc_errors[62a5cc7b06393f71]::ErrorReported>>
32:     0x7fe053755c3c - rustc_span[5840c952fc6dfb1f]::with_source_map::<core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>, rustc_interface[947fac54d3fe2868]::interface::create_compiler_and_run<core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>, rustc_driver[aab467f4c82ed6ad]::run_compiler::{closure#1}>::{closure#1}>
33:     0x7fe05377330e - rustc_interface[947fac54d3fe2868]::interface::create_compiler_and_run::<core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>, rustc_driver[aab467f4c82ed6ad]::run_compiler::{closure#1}>
34:     0x7fe05375719b - <scoped_tls[ec1705c99dfa8720]::ScopedKey<rustc_span[5840c952fc6dfb1f]::SessionGlobals>>::set::<rustc_interface[947fac54d3fe2868]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[947fac54d3fe2868]::interface::run_compiler<core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>, rustc_driver[aab467f4c82ed6ad]::run_compiler::{closure#1}>::{closure#0}, core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>::{closure#0}::{closure#0}, core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>
35:     0x7fe053756f95 - std[e740e8867e95a171]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[947fac54d3fe2868]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[947fac54d3fe2868]::interface::run_compiler<core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>, rustc_driver[aab467f4c82ed6ad]::run_compiler::{closure#1}>::{closure#0}, core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>::{closure#0}, core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>
36:     0x7fe0537838a9 - <<std[e740e8867e95a171]::thread::Builder>::spawn_unchecked<rustc_interface[947fac54d3fe2868]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[947fac54d3fe2868]::interface::run_compiler<core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>, rustc_driver[aab467f4c82ed6ad]::run_compiler::{closure#1}>::{closure#0}, core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>::{closure#0}, core[24291291a921b533]::result::Result<(), rustc_errors[62a5cc7b06393f71]::ErrorReported>>::{closure#1} as core[24291291a921b533]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
37:     0x7fe051101cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9a9713b5d2e24fc2
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/alloc/src/boxed.rs:1854:9
38:     0x7fe051101cf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h9651309876a3c2bf
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/alloc/src/boxed.rs:1854:9
39:     0x7fe051101cf3 - std::sys::unix::thread::Thread::new::thread_start::h8f346e0de1984669
                             at /rustc/e012a191d768adeda1ee36a99ef8b92d51920154/library/std/src/sys/unix/thread.rs:108:17
40:     0x7fe050ff4259 - start_thread
41:     0x7fe050dd75e3 - __GI___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-clippy/issues/new

note: Clippy version: clippy 0.1.59 (e012a19 2022-01-06)

query stack during panic:
#0 [analysis] running analysis passes on this crate
end of query stack
warning: 1 warning emitted

@matthiaskrgr matthiaskrgr added C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

1 participant