-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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: make doctest span tweak a 2024 edition change #132210
Conversation
Fixes rust-lang#132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work.
rustbot has assigned @GuillaumeGomez. Use |
Nice, thanks! @bors r+ rollup |
Should this not be treated like any other edition 2024 change then, with a migration lint (or at least a best-effort attempt at detecting cases where users may be affected) and a section in the edition 2024 book? This seems a somewhat quick decision to gate this behind edition 2024, and presumably we shouldn't leave users in the dark when they're upgrading and their code suddenly breaks. cc @traviscross |
This should definitely be in the edition 2024 book. As for the lint, I couldn't think of a good way to suggest a fix. There's no way to fix it before you migrate, and after you migrate, there already is a suggestion, as you can see in the crater reports. Rustdoc doctest nested
|
…k, r=GuillaumeGomez rustdoc: make doctest span tweak a 2024 edition change Fixes rust-lang#132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work.
@bors r- (Edition-related. Comment to follow.) |
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
While this seems a sensible change, it is very late to be adding an edition item. If this is to go into Rust 2024 at all, we need to follow some process to ensure this is ready for the edition before the change itself lands. Here's what needs to happen:
Hopefully this list doesn't seem too daunting. On net, I probably would like to see this happen. But there's some catch-up needed here if this is going to happen, and these items will need to all happen within a very short time -- days, not weeks. Looking at the breakage, one alternative that the rustdoc team might want consider here is whether this bug might be fixed without making this an edition item at all. Perhaps there is a way to issue a FCW if it seems a crate is relying on the bug? Then PRs could be submitted to the affected crates. After some time, then perhaps the change could be landed (in all editions). Please let us know what you want to do here, in particular if you do plan to quickly complete the steps needed to make this an edition item. |
The edition guide change is merged. There are no edition migration lints for this. @GuillaumeGomez has confirmed the rustdoc team wants this as an edition item. On the edition side, we've discussed and can fit this into our testing with it merging now, so let's get it in. I would r+ this, but it looks like from the logs above that some tests here still need to be fixed. When that's resolved, this is good to go, |
Okay, ignoring windows on the test that cares about path syntax. |
Issue was approved so I'm planning on r+ing this PR by this evening. CI seems to have been cancelled so I'll wait for @notriddle to take another look here before doing anything. |
This comment has been minimized.
This comment has been minimized.
CI is failing. Once fixed, please r=me. :) |
5831139
to
ac7de1a
Compare
@bors r=GuillaumeGomez |
…ack, r=GuillaumeGomez rustdoc: make doctest span tweak a 2024 edition change Fixes rust-lang#132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work.
…kingjubilee Rollup of 5 pull requests Successful merges: - rust-lang#129383 (Remap impl-trait lifetimes on HIR instead of AST lowering) - rust-lang#132210 (rustdoc: make doctest span tweak a 2024 edition change) - rust-lang#132246 (Rename `rustc_abi::Abi` to `BackendRepr`) - rust-lang#132267 (force-recompile library changes on download-rustc="if-unchanged") - rust-lang#132344 (Merge `HostPolarity` and `BoundConstness`) Failed merges: - rust-lang#132347 (Remove `ValueAnalysis` and `ValueAnalysisWrapper`.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132210 - notriddle:notriddle/doctest-span-hack, r=GuillaumeGomez rustdoc: make doctest span tweak a 2024 edition change Fixes rust-lang#132203 This is a compatibility hack, because I think the new behavior is better. When an A `include_str!` B, and B `include_str!` C, the path to C should be resolved relative to B, not A. That's how `include!` itself works, so that's how `include_str!` with should work.
Fixes #132203
This is a compatibility hack, because I think the new behavior is better. When an A
include_str!
B, and Binclude_str!
C, the path to C should be resolved relative to B, not A. That's howinclude!
itself works, so that's howinclude_str!
with should work.