Repository navigation
rustc panic when running cargo doc in AutoTraitFinder::find_auto_trait_generics #72213
Description
Activity
- addedC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on May 14, 2020 - addedT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.A-trait-systemArea: Trait systemArea: Trait system
on May 14, 2020 somewhat minified:
struct Lines<'a, L> where L: Iterator<Item = &'a ()>, { words: std::iter::Peekable<Words<'a, L>>, } struct Words<'a, L> { _m: std::marker::PhantomData<&'a L>, } impl<'a, L> Iterator for Words<'a, L> where L: Iterator<Item = &'a ()>, { type Item = (); fn next(&mut self) -> Option<Self::Item> { unimplemented!() } }
Reacted by Alex ButlerSomewhat interesting:
nightly-2018-01-17 gives me:
✗ cargo doc Documenting foo v0.1.0 (file:///tmp/tmp.NxnOdGgulp/foo) error[E0309]: the parameter type `L` may not live long enough --> src/lib.rs:9:5 | 8 | struct Words<'a, L> { | - help: consider adding an explicit lifetime bound `L: 'a`... 9 | _m: std::marker::PhantomData<&'a L>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: ...so that the reference type `&'a L` does not outlive the data it points at --> src/lib.rs:9:5 | 9 | _m: std::marker::PhantomData<&'a L>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^and cargo check as gives me the same error message.
On nightly-2019-01-17 on the other hand cargo doc panics and cargo check does not complain any more:
✗ cargo check Checking foo v0.1.0 (/tmp/tmp.NxnOdGgulp/foo) warning: struct is never constructed: `Lines` --> src/lib.rs:1:1 | 1 | / struct Lines<'a, L> 2 | | where 3 | | L: Iterator<Item = &'a ()>, 4 | | { 5 | | words: std::iter::Peekable<Words<'a, L>>, 6 | | } | |_^ | = note: #[warn(dead_code)] on by default warning: struct is never constructed: `Words` --> src/lib.rs:8:1 | 8 | struct Words<'a, L> { | ^^^^^^^^^^^^^^^^^^^Edit: nightly-2018-12-01 gives me exactly no output. No warning, no ICE. That is weird as well...
Reacted by Alex ButlerRegression in nightly-2018-12-08 (14997d5...4a45578) (nightly-2018-12-07 is not available)
The "no output" regression (from rejecting the program as such and giving no output at all) is in nightly-2018-09-13 (2f1547c...f2302da)
The latter is an intended change caused by #53793
This is still occurring, the panic seems to come from this line in
AutoTraitFinder::find_auto_trait_generics.Updated info:
rustc --version --verbose:rustc 1.45.1 (c367798cf 2020-07-26) binary: rustc commit-hash: c367798cfd3817ca6ae908ce675d1d99242af148 commit-date: 2020-07-26 host: x86_64-unknown-linux-gnu release: 1.45.1 LLVM version: 10.0Error output
thread 'rustc' panicked at 'Unable to fulfill trait DefId(2:1944 ~ core[6c88]::marker[0]::Unpin[0]) for 'lines::Lines<'a, 'b, L, F, S>': [FulfillmentError(Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { substs: [S], item_def_id: DefId(2:4966 ~ core[6c88]::iter[0]::traits[0]::iterator[0]::Iterator[0]::Item[0]) }, section::SectionText<'_>)), depth=3),Ambiguity)]', /rustc/c367798cfd3817ca6ae908ce675d1d99242af148/src/libstd/macros.rs:16:9Backtrace
thread 'rustc' panicked at 'Unable to fulfill trait DefId(2:1944 ~ core[6c88]::marker[0]::Unpin[0]) for 'lines::Lines<'a, 'b, L, F, S>': [FulfillmentError(Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { substs: [S], item_def_id: DefId(2:4966 ~ core[6c88]::iter[0]::traits[0]::iterator[0]::Iterator[0]::Item[0]) }, section::SectionText<'_>)), depth=3),Ambiguity)]', /rustc/c367798cfd3817ca6ae908ce675d1d99242af148/src/libstd/macros.rs:16:9 stack backtrace: 0: backtrace::backtrace::libunwind::trace at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86 1: backtrace::backtrace::trace_unsynchronized at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66 2: std::sys_common::backtrace::_print_fmt at src/libstd/sys_common/backtrace.rs:78 3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt at src/libstd/sys_common/backtrace.rs:59 4: core::fmt::write at src/libcore/fmt/mod.rs:1076 5: std::io::Write::write_fmt at src/libstd/io/mod.rs:1537 6: std::sys_common::backtrace::_print at src/libstd/sys_common/backtrace.rs:62 7: std::sys_common::backtrace::print at src/libstd/sys_common/backtrace.rs:49 8: std::panicking::default_hook::{{closure}} at src/libstd/panicking.rs:198 9: std::panicking::default_hook at src/libstd/panicking.rs:218 10: std::panicking::rust_panic_with_hook at src/libstd/panicking.rs:486 11: rust_begin_unwind at src/libstd/panicking.rs:388 12: std::panicking::begin_panic_fmt at src/libstd/panicking.rs:342 13: rustc_trait_selection::traits::auto_trait::AutoTraitFinder::find_auto_trait_generics::{{closure}}::{{closure}} 14: rustc_middle::ty::context::GlobalCtxt::enter_local 15: rustc_trait_selection::traits::auto_trait::AutoTraitFinder::find_auto_trait_generics 16: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut 17: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter 18: rustdoc::clean::utils::get_auto_trait_and_blanket_impls 19: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::fold::DocFolder>::fold_item 20: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter 21: rustdoc::fold::DocFolder::fold_inner_recur 22: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::fold::DocFolder>::fold_item 23: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter 24: rustdoc::fold::DocFolder::fold_inner_recur 25: <rustdoc::passes::collect_trait_impls::SyntheticImplCollector as rustdoc::fold::DocFolder>::fold_item 26: rustdoc::passes::collect_trait_impls::collect_trait_impls 27: rustc_middle::ty::context::tls::enter_global 28: rustc_interface::interface::run_compiler_in_existing_thread_pool 29: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once 30: rustc_driver::catch_fatal_errors 31: rustdoc::main_options 32: scoped_tls::ScopedKey<T>::set 33: rustc_ast::attr::with_globals note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. error: Could not document `glyph_brush_layout`.- changed the title
[-]rustc panic when running `cargo doc`: Unable to fulfill trait DefId(2:1922[/-][+]rustc panic when running `cargo doc` in AutoTraitFinder::find_auto_trait_generics[/+]on Aug 1, 2020 - addedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Aug 1, 2020 Assigning
P-highas discussed as part of the Prioritization Working Group procedure and removingI-prioritize.- addedP-highHigh priorityHigh priorityand removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Aug 5, 2020 - added a commit that references this issue
on Aug 6, 2020 - added a commit that references this issue
on Aug 12, 2020
rustc panic when running
cargo doc. The crate otherwise seems to test, run & work fine.Steps to reproduce
ca74e6a25b26eed68b9513363bb45167a3729cd3.cargo doc -p glyph_brush_layout.Meta
rustc --version --verbose:Error output
Backtrace