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

no_run doctests no longer verify lints #31576

Closed
alexcrichton opened this issue Feb 11, 2016 · 11 comments
Closed

no_run doctests no longer verify lints #31576

alexcrichton opened this issue Feb 11, 2016 · 11 comments
Assignees
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@alexcrichton
Copy link
Member

For code like this:

#![doc(test(attr(deny(warnings))))]

/// ```no_run
/// let a = 3;
/// ```
pub fn foo() {}

The stable/beta rustdoc will generate an error, while the nightly rustdoc will pass silently. This block looks suspicious perhaps?

r? cc @nrc

@alexcrichton
Copy link
Member Author

er, that r? was meant to be a cc

@alexcrichton alexcrichton added I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. labels Feb 11, 2016
@alexcrichton
Copy link
Member Author

Tagging as a regression and nominating

@crumblingstatue
Copy link
Contributor

The borrow checker also does not seem to operate on no_run tests.

//! ```no_run
//! fn main() {
//! let mut s = "hello".to_owned();
//! let ref1 = &mut s;
//! let ref2 = &mut s;
//! }
//! ```

Will pass the Doc-tests.

@steveklabnik
Copy link
Member

@crumblingstatue 's error does not happen on

rustc 1.9.0-nightly  (388ccda45 2016-03-07)

so it must have happened recently.

@crumblingstatue
Copy link
Contributor

@steveklabnik
The Doc-Test also passes on rustc 1.8.0-beta.1 (facbfdd71 2016-03-02). It fails on stable, which is the correct behavior.
How are you testing it?
I use rustdoc --test foo.rs

@steveklabnik
Copy link
Member

I meant that the test fails, sorry. I cannot reproduce the bug.

On Mar 10, 2016, 15:35 +0100, Mika [email protected], wrote:

@steveklabnik(https://github.com/steveklabnik)
The Doc-Test also passes onrustc 1.8.0-beta.1 (facbfdd 2016-03-02). It fails on stable, which is the correct behavior.
How are you testing it?
I userustdoc --test foo.rs


Reply to this email directly orview it on GitHub(#31576 (comment)).

@crumblingstatue
Copy link
Contributor

Just to show a real life case, and the fact that this is not just an anomaly on my local system, here is a travis build of a project that passes on both beta and nightly, but fails (properly) on stable.

https://travis-ci.org/jeremyletang/rust-sfml/builds/115021280

@nikomatsakis
Copy link
Contributor

@nrc, any thoughts?

@nikomatsakis nikomatsakis added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 7, 2016
@nikomatsakis
Copy link
Contributor

tagging with T-compiler just so we can review in compiler mtg, even though it's sort of more tools.

@nrc nrc added P-high High priority and removed I-nominated labels Apr 7, 2016
@nikomatsakis
Copy link
Contributor

triage: P-high

@rust-highfive rust-highfive added P-high High priority and removed P-high High priority labels Apr 7, 2016
@alexcrichton
Copy link
Member Author

Bisection-via-nightly turns up 2016-02-01 was the last good and 2016-02-02 is the first bad. This points to some commit between 094c5b0 and b94cd7a, of which the most suspect is #31250.

This line looks quite suspect, returning that there are 0 errors when result may otherwise indicate that errors would have happened.

Ok so after writing all that up I tested it out and I'll just make a PR soon.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 8, 2016
This was a regression introduced by rust-lang#31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes rust-lang#31576
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 8, 2016
 This was a regression introduced by rust-lang#31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes rust-lang#31576
alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 11, 2016
This was a regression introduced by rust-lang#31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes rust-lang#31576
bors added a commit that referenced this issue Apr 12, 2016
rustdoc: Fix testing no_run code blocks

This was a regression introduced by #31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.

Closes #31576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants