fix rustc_lint_defs doctest issues - #161880
Merged
Merged
Conversation
Collaborator
|
rustbot has assigned @JonathanBrouwer. Use Why was this reviewer chosen?The reviewer was selected based on:
|
RalfJung
force-pushed
the
rustc_lint_defs-doctests
branch
2 times, most recently
from
August 27, 2026 18:59
24fdac6 to
af5a8af
Compare
bjorn3
reviewed
Aug 27, 2026
RalfJung
force-pushed
the
rustc_lint_defs-doctests
branch
from
August 27, 2026 19:19
af5a8af to
5333d84
Compare
RalfJung
commented
Aug 27, 2026
| /// ```rust,compile_fail | ||
| /// #![deny(warnings)] | ||
| /// fn foo() {} | ||
| /// struct non_standard_name; |
Member
Author
There was a problem hiding this comment.
I changed which warning we trigger because rustdoc can inject both allow(unused) and allow(non_snake_case) depending on circumstances, making them not reliable examples here.
RalfJung
force-pushed
the
rustc_lint_defs-doctests
branch
from
August 27, 2026 19:25
5333d84 to
a0ec511
Compare
JonathanBrouwer
approved these changes
Aug 28, 2026
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 28, 2026
… r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 28, 2026
… r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 28, 2026
… r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 28, 2026
…uwer Rollup of 15 pull requests Successful merges: - #160170 (Refactored docs for `std::fs::set_permissions_nofollow` + fix BSD-based systems to use fchmodat with AT_SYMLINK_NOFOLLOW flag) - #160594 (attach global target features to module-level assembly) - #161858 (fix ICE in generic_const_parameter_types with inherents) - #161353 (Add test for parallel compiler reproducible build) - #161377 ([bootstrap] Don't reverse the order of dylib search path entries) - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd) - #161865 (loongarch: support passing `u128`/`i128` to inline assembly) - #161877 (Do not load macro metadata for local definitions in rustdoc) - #161880 (fix rustc_lint_defs doctest issues) - #161883 (better deal with internal features being injected into doctests) - #161887 (std: uefi: fix File::seek returning the EOF sentinel) - #161897 (Reject contract attributes without arguments) - #161909 (Report the configured Polonius default in -Z help) - #161910 (Add rustdoc-html regression test for generated macro) - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0))
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 28, 2026
… r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 28, 2026
…uwer Rollup of 16 pull requests Successful merges: - #160170 (Refactored docs for `std::fs::set_permissions_nofollow` + fix BSD-based systems to use fchmodat with AT_SYMLINK_NOFOLLOW flag) - #161945 (std: optimise IO error formatting) - #160594 (attach global target features to module-level assembly) - #161577 (implement [u8]::split_ascii_whitespace) - #161858 (fix ICE in generic_const_parameter_types with inherents) - #161377 ([bootstrap] Don't reverse the order of dylib search path entries) - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd) - #161865 (loongarch: support passing `u128`/`i128` to inline assembly) - #161877 (Do not load macro metadata for local definitions in rustdoc) - #161880 (fix rustc_lint_defs doctest issues) - #161883 (better deal with internal features being injected into doctests) - #161887 (std: uefi: fix File::seek returning the EOF sentinel) - #161897 (Reject contract attributes without arguments) - #161909 (Report the configured Polonius default in -Z help) - #161910 (Add rustdoc-html regression test for generated macro) - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0))
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Aug 28, 2026
… r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 29, 2026
…uwer Rollup of 16 pull requests Successful merges: - #161945 (std: optimise IO error formatting) - #160594 (attach global target features to module-level assembly) - #161577 (implement [u8]::split_ascii_whitespace) - #161858 (fix ICE in generic_const_parameter_types with inherents) - #161377 ([bootstrap] Don't reverse the order of dylib search path entries) - #161702 (Use `drop_guard` in some places in {core,alloc,std}) - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd) - #161865 (loongarch: support passing `u128`/`i128` to inline assembly) - #161877 (Do not load macro metadata for local definitions in rustdoc) - #161880 (fix rustc_lint_defs doctest issues) - #161883 (better deal with internal features being injected into doctests) - #161887 (std: uefi: fix File::seek returning the EOF sentinel) - #161897 (Reject contract attributes without arguments) - #161909 (Report the configured Polonius default in -Z help) - #161910 (Add rustdoc-html regression test for generated macro) - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0))
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Aug 29, 2026
… r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 29, 2026
Rollup of 17 pull requests Successful merges: - #161945 (std: optimise IO error formatting) - #160594 (attach global target features to module-level assembly) - #161577 (implement [u8]::split_ascii_whitespace) - #161858 (fix ICE in generic_const_parameter_types with inherents) - #161377 ([bootstrap] Don't reverse the order of dylib search path entries) - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd) - #161865 (loongarch: support passing `u128`/`i128` to inline assembly) - #161877 (Do not load macro metadata for local definitions in rustdoc) - #161880 (fix rustc_lint_defs doctest issues) - #161883 (better deal with internal features being injected into doctests) - #161887 (std: uefi: fix File::seek returning the EOF sentinel) - #161897 (Reject contract attributes without arguments) - #161909 (Report the configured Polonius default in -Z help) - #161910 (Add rustdoc-html regression test for generated macro) - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0)) - #161924 (Windows: document that `normalize_lexically` converts `/` to `\`) - #161927 (Change `rustc_middle/src/hooks/mod.rs` to `hooks.rs`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 29, 2026
Rollup of 17 pull requests Successful merges: - #161945 (std: optimise IO error formatting) - #160594 (attach global target features to module-level assembly) - #161577 (implement [u8]::split_ascii_whitespace) - #161858 (fix ICE in generic_const_parameter_types with inherents) - #161377 ([bootstrap] Don't reverse the order of dylib search path entries) - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd) - #161865 (loongarch: support passing `u128`/`i128` to inline assembly) - #161877 (Do not load macro metadata for local definitions in rustdoc) - #161880 (fix rustc_lint_defs doctest issues) - #161883 (better deal with internal features being injected into doctests) - #161887 (std: uefi: fix File::seek returning the EOF sentinel) - #161897 (Reject contract attributes without arguments) - #161909 (Report the configured Polonius default in -Z help) - #161910 (Add rustdoc-html regression test for generated macro) - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0)) - #161924 (Windows: document that `normalize_lexically` converts `/` to `\`) - #161927 (Change `rustc_middle/src/hooks/mod.rs` to `hooks.rs`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 29, 2026
Rollup of 17 pull requests Successful merges: - #161945 (std: optimise IO error formatting) - #160594 (attach global target features to module-level assembly) - #161577 (implement [u8]::split_ascii_whitespace) - #161858 (fix ICE in generic_const_parameter_types with inherents) - #161377 ([bootstrap] Don't reverse the order of dylib search path entries) - #161804 (Document PartialOrd behavior for Option<T> where T: PartialOrd) - #161865 (loongarch: support passing `u128`/`i128` to inline assembly) - #161877 (Do not load macro metadata for local definitions in rustdoc) - #161880 (fix rustc_lint_defs doctest issues) - #161883 (better deal with internal features being injected into doctests) - #161887 (std: uefi: fix File::seek returning the EOF sentinel) - #161888 (compiler: Allow safestack to be togglable via #[sanitize(safestack = "...")]) - #161897 (Reject contract attributes without arguments) - #161910 (Add rustdoc-html regression test for generated macro) - #161914 (Retroactively add relnotes for `bool::{ok_or,ok_or_else}` (1.98.0)) - #161924 (Windows: document that `normalize_lexically` converts `/` to `\`) - #161927 (Change `rustc_middle/src/hooks/mod.rs` to `hooks.rs`)
rust-bors Bot
pushed a commit
that referenced
this pull request
Aug 29, 2026
Rollup merge of #161880 - RalfJung:rustc_lint_defs-doctests, r=JonathanBrouwer fix rustc_lint_defs doctest issues Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected. See [Zulip](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/Strange.20behavior.20for.20rustc_builtin_lints.20doctests/with/619604902) for the journey of discovery that led to this. ;)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some of these doctests should fail, but due to various complications they accidentally pass when executed in "merged" rustdoc mode. Mark them as fail, which leads to them being run as separate doctests, and then they behave as expected.
See Zulip for the journey of discovery that led to this. ;)