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

"trait objects are not yet implemented" ICE in rustdoc #57595

Closed
jonas-schievink opened this issue Jan 14, 2019 · 4 comments
Closed

"trait objects are not yet implemented" ICE in rustdoc #57595

jonas-schievink opened this issue Jan 14, 2019 · 4 comments
Assignees
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@jonas-schievink
Copy link
Contributor

jonas-schievink commented Jan 14, 2019

Running cargo doc on 1aim/asn1@aae670cca45d8632abbd390ab18df97d89becf0e (current master) causes an ICE while running rustdoc on the serde_asn1 crate:

thread 'rustc' panicked at 'not yet implemented: trait objects are not yet implemented', src/librustdoc/visit_ast.rs:550:17
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:478
   5: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:385
   6: std::panicking::begin_panic_fmt
             at src/libstd/panicking.rs:340
   7: rustdoc::visit_ast::RustdocVisitor::visit_item
             at src/librustdoc/visit_ast.rs:550
   8: rustdoc::visit_ast::RustdocVisitor::visit_mod_contents
             at src/librustdoc/visit_ast.rs:248
   9: rustdoc::visit_ast::RustdocVisitor::visit_item
             at src/librustdoc/visit_ast.rs:458
  10: rustdoc::visit_ast::RustdocVisitor::visit_mod_contents
             at src/librustdoc/visit_ast.rs:248
  11: rustdoc::visit_ast::RustdocVisitor::visit
             at src/librustdoc/visit_ast.rs:81
  12: rustdoc::core::run_core::{{closure}}::{{closure}}
             at src/librustdoc/core.rs:546
  13: <std::thread::local::LocalKey<T>>::with
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc_driver/driver.rs:1329
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1955
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1922
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1856
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1921
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1954
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1910
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/libstd/thread/local.rs:299
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/libstd/thread/local.rs:245
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1902
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/libstd/thread/local.rs:299
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/libstd/thread/local.rs:245
  14: rustc::ty::context::TyCtxt::create_and_enter
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1894
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1933
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc/ty/context.rs:1260
  15: rustc_driver::driver::phase_3_run_analysis_passes
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc_driver/driver.rs:1234
  16: <scoped_tls::ScopedKey<T>>::set
             at src/librustdoc/core.rs:491
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc_driver/driver.rs:65
             at /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
  17: rustdoc::core::run_core
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/librustc_driver/driver.rs:64
             at src/librustdoc/core.rs:394
  18: syntax::with_globals
             at src/librustdoc/lib.rs:428
             at /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/libsyntax/lib.rs:111
             at /cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-0.1.2/src/lib.rs:155
             at /rustc/2fadb0a16c8737a45746e95df9138912590ed8ad/src/libsyntax/lib.rs:110
@Centril Centril added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jan 14, 2019
@GuillaumeGomez
Copy link
Member

I'll take a look. If you could make a code sample to get this error shorter, that'd be very appreciated.

@GuillaumeGomez GuillaumeGomez self-assigned this Jan 16, 2019
@jonas-schievink
Copy link
Contributor Author

The error message is misleading, it's caused by this code which just means that rustdoc doesn't support trait aliases at all.

Therefore, to reproduce this should be enough:

#![feature(trait_alias)]

pub trait Alias = Copy;

@GuillaumeGomez
Copy link
Member

Thanks!

@QuietMisdreavus
Copy link
Member

You have it exactly; rustdoc just doesn't support trait aliases yet. We need to figure out how we want to display it, what keywords/css classes to use, etc. This could be a @rust-lang/docs question, of how we want those pages to look. Since the keyword they (currently) use is trait, they may be trait pages that instead look and act like type aliases on their actual page (i.e. their "definition" is just the trait Thing = OtherThing line, the alias-specific docs print underneath that, and there's no other headings on the page). I'm not sure if it will cause a problem to have them collide with actual trait pages, but i think it could work out.

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Feb 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants