Repository: rust
Issue: rustdoc: ICE: `Deref impl without Target type` involving negative `Deref` impl
Labels: T-rustdoc,I-ICE,P-low,F-negative_impls,S-has-mcve

**Reproducer**:

```rs
#![feature(negative_impls)]

pub struct Source;

impl !std::ops::Deref for Source {}
```

**Rustdoc Output**:

```
thread 'rustc' panicked at src/librustdoc/passes/collect_trait_impls.rs:172:18:
Deref impl without Target type
```

<details><summary>Full Rustdoc Output (incl. backtrace)</summary>

```
thread 'rustc' panicked at src/librustdoc/passes/collect_trait_impls.rs:172:18:
Deref impl without Target type
stack backtrace:
   0:     0x7eef2289e055 - std::backtrace_rs::backtrace::libunwind::trace::h06bc9b86d9774048
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1:     0x7eef2289e055 - std::backtrace_rs::backtrace::trace_unsynchronized::hdda4e98324ad77bc
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7eef2289e055 - std::sys::backtrace::_print_fmt::h1f4c993ef7e831ac
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/sys/backtrace.rs:68:9
   3:     0x7eef2289e055 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h698f896ade9481b5
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/sys/backtrace.rs:41:26
   4:     0x7eef228eef2b - core::fmt::rt::Argument::fmt::haa88e56ba5e1296a
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/core/src/fmt/rt.rs:173:76
   5:     0x7eef228eef2b - core::fmt::write::h3d0682ae14ea41eb
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/core/src/fmt/mod.rs:1182:21
   6:     0x7eef2289294f - std::io::Write::write_fmt::hc60fd9ed89ca5cb9
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/io/mod.rs:1827:15
   7:     0x7eef228a08f1 - std::sys::backtrace::BacktraceLock::print::h5f66c3d07f69e011
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/sys/backtrace.rs:44:9
   8:     0x7eef228a08f1 - std::panicking::default_hook::{{closure}}::h1a9e38caae8056a1
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/panicking.rs:269:22
   9:     0x7eef228a05cc - std::panicking::default_hook::h7e7b66ab2d01b158
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/panicking.rs:296:9
  10:     0x7eef1ee3c97a - std[aa7fdb062f64e277]::panicking::update_hook::<alloc[212cbeab23b2ab6c]::boxed::Box<rustc_driver_impl[248cc289afe8af4d]::install_ice_hook::{closure#0}>>::{closure#0}
  11:     0x7eef228a12bf - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h29dbd1b8e444e7ae
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/alloc/src/boxed.rs:2165:9
  12:     0x7eef228a12bf - std::panicking::rust_panic_with_hook::hd02d3e24e17903a0
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/panicking.rs:808:13
  13:     0x7eef228a0ee7 - std::panicking::begin_panic_handler::{{closure}}::h7b7916e18a955842
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/panicking.rs:674:13
  14:     0x7eef2289e519 - std::sys::backtrace::__rust_end_short_backtrace::h95ffcaec96e3d90f
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/sys/backtrace.rs:172:18
  15:     0x7eef228a0b74 - rust_begin_unwind
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/panicking.rs:665:5
  16:     0x7eef228eb4f3 - core::panicking::panic_fmt::h167c2e689054226b
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/core/src/panicking.rs:74:14
  17:     0x7eef228eb34b - core::panicking::panic_display::he27d6e1112e8652e
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/core/src/panicking.rs:264:5
  18:     0x7eef228eb34b - core::option::expect_failed::h58f41ae4354f123a
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/core/src/option.rs:2030:5
  19:     0x5cc12f39972f - rustdoc[43ed1fd591799718]::passes::collect_trait_impls::collect_trait_impls
  20:     0x5cc12f2b0429 - rustdoc[43ed1fd591799718]::core::run_global_ctxt
  21:     0x5cc12f16646f - <rustc_middle[8bb12d3a11dd28f7]::ty::context::GlobalCtxt>::enter::<rustdoc[43ed1fd591799718]::main_args::{closure#1}::{closure#0}::{closure#0}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>::{closure#1}
  22:     0x5cc12f16fd6f - rustc_interface[508d3ee0c578cb86]::interface::run_compiler::<core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>, rustdoc[43ed1fd591799718]::main_args::{closure#1}>::{closure#1}
  23:     0x5cc12f0fad65 - std[aa7fdb062f64e277]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[508d3ee0c578cb86]::util::run_in_thread_with_globals<rustc_interface[508d3ee0c578cb86]::util::run_in_thread_pool_with_globals<rustc_interface[508d3ee0c578cb86]::interface::run_compiler<core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>, rustdoc[43ed1fd591799718]::main_args::{closure#1}>::{closure#1}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>::{closure#0}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>
  24:     0x5cc12f17b817 - <<std[aa7fdb062f64e277]::thread::Builder>::spawn_unchecked_<rustc_interface[508d3ee0c578cb86]::util::run_in_thread_with_globals<rustc_interface[508d3ee0c578cb86]::util::run_in_thread_pool_with_globals<rustc_interface[508d3ee0c578cb86]::interface::run_compiler<core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>, rustdoc[43ed1fd591799718]::main_args::{closure#1}>::{closure#1}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>::{closure#0}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6449c673ca1a28dc]::result::Result<(), rustc_span[e48981e571852391]::ErrorGuaranteed>>::{closure#1} as core[6449c673ca1a28dc]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  25:     0x7eef228ab20b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h009d53349cd0b13e
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/alloc/src/boxed.rs:2151:9
  26:     0x7eef228ab20b - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h497de5feb0301a41
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/alloc/src/boxed.rs:2151:9
  27:     0x7eef228ab20b - std::sys::pal::unix::thread::Thread::new::thread_start::hf327ce4ae0a5d31b
                               at /rustc/2cbbe8b8bb2be672b14cf741a2f0ec24a49f3f0b/library/std/src/sys/pal/unix/thread.rs:108:17
  28:     0x7eef1b7bbded - <unknown>
  29:     0x7eef1b83f0dc - <unknown>
  30:                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-rustdoc&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.82.0-nightly (2cbbe8b8b 2024-07-28) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: process exited unsuccessfully: exit status: 101
```

</details>