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

rustdoc panics if target crate has compilation errors #19181

Closed
japaric opened this issue Nov 21, 2014 · 8 comments
Closed

rustdoc panics if target crate has compilation errors #19181

japaric opened this issue Nov 21, 2014 · 8 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@japaric
Copy link
Member

japaric commented Nov 21, 2014

Updated issue

STR

// err.rs
fn main() { 0 }

Output

$ rustc err.rs 2>/dev/null || echo compilation error as expected
compilation error as expected
$ rustdoc err.rs
err.rs:2:5: 2:6 error: mismatched types: expected `()`, found `_` (expected (), found integral variable)
err.rs:2     0
             ^
error: aborting due to previous error
task '<unnamed>' panicked at 'Box<Any>', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/diagnostic.rs:142
task '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: rustc failed', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libcore/result.rs:743

Original issue: rustdoc panics with #![deny(missing_docs] and associated items

STR

#![deny(missing_docs)]
#![feature(associated_types)]

//! Crate

/// Trait
pub trait AsSlice {
    /// Item
    type Item;

    // Forgot to document the method
    fn as_slice(&self) -> &[<Self as AsSlice>::Item];
}

Output

ai.rs:12:5: 12:53 error: missing documentation for a type method
ai.rs:12     fn as_slice(&self) -> &[<Self as AsSlice>::Item];
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ai.rs:1:9: 1:21 note: lint level defined here
ai.rs:1 #![deny(missing_docs)]
                ^~~~~~~~~~~~
error: aborting due to previous error
task '<unnamed>' panicked at 'Box<Any>', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/diagnostic.rs:142
task '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: rustc failed', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libcore/result.rs:743

Version

#19174 on top of c9f6d69

cc @tomjakubowski

@tomjakubowski
Copy link
Contributor

This is a more general problem with rustdoc; it panics on any compilation error.

@japaric
Copy link
Member Author

japaric commented Nov 21, 2014

@tomjakubowski Ah yes, you are right, I've seen that before. Do you know if there's a tracking issue for that (rustdoc panics on any compilation error)?

@kmcallister kmcallister 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 Nov 23, 2014
@tomjakubowski
Copy link
Contributor

@japaric I don't think there is a more general issue for this, might be reasonable to repurpose this issue :)

@japaric japaric changed the title rustdoc panics with #![deny(missing_docs] and associated items rustdoc panics if target crate has compilation errors Nov 27, 2014
@japaric
Copy link
Member Author

japaric commented Nov 27, 2014

@tomjakubowski Done!

@tamird
Copy link
Contributor

tamird commented Apr 21, 2015

@steveklabnik I think this should not be tagged I-ICE since it is strictly a rustdoc issue.

@steveklabnik steveklabnik removed the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Apr 21, 2015
@bltavares
Copy link
Contributor

Triaging this issue.

It still happens on rustc 1.7.0-nightly (b4707ebca 2015-12-27)

@mitaa
Copy link
Contributor

mitaa commented Feb 19, 2016

The two testcases don't panic for me (fixed/needstest ?)

rustdoc 1.8.0-nightly (57c357d89 2016-02-16)

@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum
Copy link
Member

Yeah, this has been fixed. E-needstest.

error[E0308]: mismatched types
 --> test.rs:2:13
  |
2 | fn main() { 0 }
  |             ^ expected (), found integral variable
  |
  = note: expected type `()`
             found type `{integer}`

error: Compilation failed, aborting rustdoc

@Mark-Simulacrum Mark-Simulacrum added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jul 22, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this issue Jul 26, 2017
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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. 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

8 participants