-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
regression: doctest failure display-as-0.4.4 #61562
Comments
This is strange; it looks like the behavior for detecting doctests changed? What's the commit range for [misdreavus@tonberry display-as]$ cargo +stable test --doc [17/1140]
Finished dev [unoptimized + debuginfo] target(s) in 0.28s
Doc-tests display-as
running 8 tests
test src/lib.rs - (line 113) ... ok
test src/lib.rs - (line 149) ... ignored
test src/lib.rs - (line 100) ... ok
test src/lib.rs - (line 127) ... ok
test src/html.rs - display_floats_as (line 78) ... ok
test src/lib.rs - (line 58) ... ok
test src/lib.rs - (line 72) ... ok
test src/lib.rs - (line 85) ... ok
test result: ok. 7 passed; 0 failed; 1 ignored; 0 measured; 0 filtered out
[misdreavus@tonberry display-as]$ cargo +local test --doc
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Doc-tests display-as
running 12 tests test src/lib.rs - (line 104) ... ok
test src/lib.rs - (line 156) ... ignored test src/lib.rs - (line 178) ... ignored
test src/lib.rs - (line 183) ... ignored
test src/lib.rs - (line 188) ... ignored
test src/lib.rs - (line 133) ... ok
test src/lib.rs - (line 118) ... ok
test src/html.rs - display_floats_as (line 78) ... ok
test src/lib.rs - (line 74) ... ok
test src/lib.rs - (line 59) ... ok
test src/lib.rs - (line 88) ... ok
test src/lib.rs - (line 193) ... FAILED
failures:
---- src/lib.rs - (line 193) stdout ----
thread 'src/lib.rs - (line 193)' panicked at 'test executable failed:
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `"<title>PH365: Templates</title>\n<html>\n <ul><li><span class=\"student\">Name: David</span>\n\n</li><li><span class=\"student\">Name: Joel<
/span>\n\n</li></ul>\n</html>\n\n\n"`,
right: `"<title>PH365: Templates</title>\n<html>\n <ul>\n\n // This is buggy: I want to iterate, but it fails!\n for s in self.students.iter() {\n
\"<li>\" s \"</li>\"\n }\n\n </ul>\n</html>\n\n\n"`', src/lib.rs:18:1
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
', src/librustdoc/test.rs:342:17
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failures:
src/lib.rs - (line 193)
test result: FAILED. 7 passed; 1 failed; 4 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--doc' The doctest in question (the one at the very end of the crate docs) seems like it's not being run at all on stable. When i extracted the doctest into a standalone crate, it failed in the same way when i built it with stable. |
It looks like this was caused by #60140 giving pulldown the ability to detect more doctests. It looks like this doctest was accidentally ignored by the older version of pulldown, which the crate author didn't notice before publishing. (The repo also hasn't been touched after the new pulldown was enabled, which is probably why this wasn't noticed.) @rust-lang/rustdoc Since this doesn't seem to have affected many crates, it's possible we can let this slide, but the alternative is we roll back the pulldown upgrade and have another warning period. Just like when we introduced pulldown in the first place. |
It's a fix so I wonder if this applies the same way... |
Any idea why it isn't being run in the stable compiler, and how I could fix that? The comment indicates that I expected a bug (it's vague in my memory) but I'd like to fix the test. |
@droundy It looks like the code blocks where you linked in the template files are empty when |
@Mark-Simulacrum does this need to be tagged T-compiler? Seems like a pure rustdoc issue to me, but maybe I misunderstand? |
So this isn't a bug in rustdoc at all, right? This is a bug that we fixed, and the failure was pre-existing? |
Since the change is fixing a bug and the backwards incompatible change landed almost 18 months ago, I'm going to close this. |
Behavior change from stable to beta but I have not investigated or tried to narrow down to anything more specific. Possibly a rustdoc problem (failure is in a doc test) so tagging with T-rustdoc.
The text was updated successfully, but these errors were encountered: