-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Rollup of 12 pull requests #144799
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
Closed
Closed
Rollup of 12 pull requests #144799
Conversation
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
rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url". however, only inline links ([text](url)) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url. the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url. Co-authored-by: Michael Howell <[email protected]>
this is in an effort to reduce the amount of code churn caused by this lint triggering on text that was never meant to be a link. a more principled hierustic for ignoring lints is not possible without extensive changes, due to the lint emitting code being so far away from the link collecting code, and the fact that only the link collecting code has access to details about how the link appears in the unnormalized markdown.
collapsed links and reference links have a pretty particular syntax, it seems unlikely they would show up on accident. Co-authored-by: León Orell Valerian Liehr <[email protected]>
These examples feature Rust code that's presented primarily to illustrate how its compilation would be handled, and these examples are formatted to highlight those aspects in ways that rustfmt wouldn't preserve. Turn formatting off in those examples. (Doc code isn't formatted yet, but this will make it easier to enable doc code formatting in the future.)
Because doc code does not get automatically formatted, some doc code has creative placements of comments that automatic formatting can't handle. Reformat those comments to make the resulting code support standard Rust formatting without breaking; this is generally an improvement to readability as well. Some comments are not indented to the prevailing indent, and are instead aligned under some bit of code. Indent them to the prevailing indent, and put spaces *inside* the comments to align them with code. Some comments span several lines of code (which aren't the line the comment is about) and expect alignment. Reformat them into one comment not broken up by unrelated intervening code. Some comments are placed on the same line as an opening brace, placing them effectively inside the subsequent block, such that formatting would typically format them like a line of that block. Move those comments to attach them to what they apply to. Some comments are placed on the same line as a one-line braced block, effectively attaching them to the closing brace, even though they're about the code inside the block. Reformat to make sure the comment will stay on the same line as the code it's commenting.
This leads tools like rustfmt to get confused, because the doc code block effectively spans two doc comments. As a result, the tools think the first code block is unclosed, and the subsequent terminator opens a new block. Move the FIXME comments outside the doc code blocks, instead.
This makes it easier for humans to parse, and improves the result of potential future automatic formatting.
Placing the opening triple-backquote inside a `cfg_attr` makes many tools confused, including syntax highlighters (e.g. vim's) and rustfmt. Instead, use a `cfg` inside the doc code block.
The AIX linkage model doesn't support ELF style extern_weak semantic, so just skip this test, like other platforms that don't have it.
Otherwise, this can do weird things like use a global rustc, or try to use stage 0 rustc. This must be properly configured, because `compiletest` is intended to only support one compiler target spec JSON format (of the in-tree compiler).
Signed-off-by: Jonathan Brouwer <[email protected]>
…k-warn-more-54191, r=GuillaumeGomez get rid of some false negatives in rustdoc::broken_intra_doc_links rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url". however, only inline links (`[text](url)`) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url. the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url. fixes rust-lang#54191 to minimize the number of false positives that will be introduced, the following heuristic is used: If there's no backticks, be lenient revert to old behavior. This is to prevent churn by linting on stuff that isn't meant to be a link. only shortcut links have simple enough syntax that they are likely to be written accidentlly, collapsed and reference links need 4 metachars, and reference links will not usually use backticks in the reference name. therefore, only shortcut syntax gets the lenient behavior. here's a truth table for how link kinds that cannot be urls are handled: | | is shortcut link | not shortcut link | |--------------|--------------------|-------------------| | has backtick | never ignore | never ignore | | no backtick | ignore if url-like | never ignore |
…=fmease [rustdoc] Add support for associated items in "jump to def" feature Fixes rust-lang#135485. r? ````@fmease````
…loop-match, r=WaffleLapkin loop match: error on `#[const_continue]` outside `#[loop_match]` tracking issue rust-lang#132306 fixes rust-lang#143119 fixes rust-lang#143165 Fixes several ICEs because a panic was reachable. ````@rustbot```` label +F-loop_match
…ppers, r=t-rustdoc [rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers. Use Rust 2024 edition representation for unsafe attributes in rustdoc HTML: - `#[no_mangle]` -> `#[unsafe(no_mangle)]` - `#[export_name = "foo"]` -> `#[unsafe(export_name = "foo")]` - `#[link_section = ".text"]` -> `#[unsafe(link_section = ".text")]` The 2024 edition representation is used regardless of the crate's own edition. This ensures that Rustaceans don't have to learn the rules of an outdated edition (e.g. that `unsafe()` wasn't always necessary) in order to understand a crate's documentation. After some looking through the `T-rustdoc` issues, I was not able to find an existing issue for this. Apologies if I missed it. r? ````@aDotInTheVoid````
…rep, r=Amanieu Improve formatting of doc code blocks We don't currently apply automatic formatting to doc comment code blocks. As a result, it has built up various idiosyncracies, which make such automatic formatting difficult. Some of those idiosyncracies also make things harder for human readers or other tools. This PR makes a few improvements to doc code formatting, in the hopes of making future automatic formatting easier, as well as in many cases providing net readability improvements. I would suggest reading each commit separately, as each commit contains one class of changes.
compiletest: Improve diagnostics for line annotation mismatches 2 Follow up to rust-lang#140622 based on feedback from rust-lang#144590.
Add human readable name "Cygwin" Closes rust-lang#144680
…Kobzol Properly pass path to staged `rustc` to `compiletest` self-tests Otherwise, this can do weird things like use a global rustc, or try to use stage 0 rustc. This must be properly configured, because `compiletest` is intended to only support one compiler target spec JSON format (of the in-tree compiler). Historically, this was probably done so before `bootstrap` was really its own thing, and `compiletest` had to be runnable as a much more "self-standing" tool. Follow-up to rust-lang#144675, as I didn't realize this until Zalathar pointed it out in [#t-infra/bootstrap > Building vs testing &rust-lang#96;compiletest&rust-lang#96; @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Building.20vs.20testing.20.60compiletest.60/near/532040838). r? ``@Kobzol``
…, r=jdonszelmann Cleanup the definition of `group_type` r? `@jdonszelmann`
…szelmann Add my previous commit name to .mailmap r? `@jdonszelmann`
…Noratrieb Update safety comment for new_unchecked in niche_types Change the safety comment on `new_unchecked` to mention the valid range instead of 0. I noticed this while working on https://github.com/model-checking/verify-rust-std
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@bors r+ p=5 rollup=never |
bors
added a commit
that referenced
this pull request
Aug 2, 2025
Rollup of 12 pull requests Successful merges: - #132748 (get rid of some false negatives in rustdoc::broken_intra_doc_links) - #135771 ([rustdoc] Add support for associated items in "jump to def" feature) - #143360 (loop match: error on `#[const_continue]` outside `#[loop_match]`) - #143662 ([rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.) - #144478 (Improve formatting of doc code blocks) - #144703 ([test][AIX] ignore extern_weak linkage test) - #144747 (compiletest: Improve diagnostics for line annotation mismatches 2) - #144766 (Add human readable name "Cygwin") - #144782 (Properly pass path to staged `rustc` to `compiletest` self-tests) - #144786 (Cleanup the definition of `group_type`) - #144796 (Add my previous commit name to .mailmap) - #144797 (Update safety comment for new_unchecked in niche_types) r? `@ghost` `@rustbot` modify labels: rollup
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-compiletest
Area: The compiletest test runner
A-meta
Area: Issues & PRs about the rust-lang/rust repository itself
A-testsuite
Area: The testsuite used to check the correctness of rustc
rollup
A PR which is a rollup
T-bootstrap
Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
T-rustdoc-frontend
Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
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.
Successful merges:
#[const_continue]
outside#[loop_match]
#143360 (loop match: error on#[const_continue]
outside#[loop_match]
)unsafe()
wrappers. #143662 ([rustdoc] Display unsafe attrs with edition 2024unsafe()
wrappers.)rustc
tocompiletest
self-tests #144782 (Properly pass path to stagedrustc
tocompiletest
self-tests)group_type
#144786 (Cleanup the definition ofgroup_type
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup