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

Comments

Projects
None yet
6 participants
@alexcrichton
Copy link
Member

alexcrichton commented Feb 11, 2016

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

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Feb 11, 2016

er, that r? was meant to be a cc

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Feb 11, 2016

Tagging as a regression and nominating

@crumblingstatue

This comment has been minimized.

Copy link
Contributor

crumblingstatue commented Mar 10, 2016

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

This comment has been minimized.

Copy link
Member

steveklabnik commented Mar 10, 2016

@crumblingstatue 's error does not happen on

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

so it must have happened recently.

@crumblingstatue

This comment has been minimized.

Copy link
Contributor

crumblingstatue commented Mar 10, 2016

@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

This comment has been minimized.

Copy link
Member

steveklabnik commented Mar 10, 2016

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

On Mar 10, 2016, 15:35 +0100, Mika Attilanotifications@github.com, 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

This comment has been minimized.

Copy link
Contributor

crumblingstatue commented Mar 10, 2016

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

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 7, 2016

@nrc, any thoughts?

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 7, 2016

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 and removed I-nominated labels Apr 7, 2016

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 7, 2016

triage: P-high

@rust-highfive rust-highfive added P-high and removed P-high labels Apr 7, 2016

@alexcrichton

This comment has been minimized.

Copy link
Member Author

alexcrichton commented Apr 7, 2016

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 7, 2016

rustdoc: Fix testing no_run code blocks
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 8, 2016

rustdoc: Fix testing no_run code blocks
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

Rollup merge of rust-lang#32811 - alexcrichton:check-lints, r=nrc
 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

Rollup merge of rust-lang#32811 - alexcrichton:check-lints, r=nrc
 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

Rollup merge of rust-lang#32811 - alexcrichton:check-lints, r=nrc
 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 9, 2016

Rollup merge of rust-lang#32811 - alexcrichton:check-lints, r=nrc
rustdoc: Fix testing no_run code blocks

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 10, 2016

Auto merge of #32811 - alexcrichton:check-lints, r=nrc
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

bors added a commit that referenced this issue Apr 10, 2016

Auto merge of #32811 - alexcrichton:check-lints, r=nrc
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

bors added a commit that referenced this issue Apr 10, 2016

Auto merge of #32811 - alexcrichton:check-lints, r=nrc
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

bors added a commit that referenced this issue Apr 11, 2016

Auto merge of #32811 - alexcrichton:check-lints, r=nrc
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

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 11, 2016

rustdoc: Fix testing no_run code blocks
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

Auto merge of #32811 - alexcrichton:check-lints, r=nrc
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

@bors bors closed this in #32811 Apr 12, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.