Skip to content

Conversation

@matthiaskrgr
Copy link
Member

@matthiaskrgr matthiaskrgr commented Nov 24, 2025

Successful merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

rperier and others added 15 commits November 20, 2025 18:37
…od_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
…thod_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
…hod_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
…d_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
…o_match_method_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
…t_no_match_method_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
…eport_no_match_method_error

Currently this method is quiet long and complex, this commit
refactors it and improves its readability by adding sub-fn
Currently this method is quiet long and complex, this commit
improves its readability, refactor and cleanup few things
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
…or-refactoring, r=lcnr

Cleanup and refactor FnCtxt::report_no_match_method_error

As discussed on zulip with `@lcnr,` this is a proposal for refactorizing this method.

See [#t-compiler/help > (PR rust-lang#144674) Merge multiple suggestions into a single @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.28PR.20.23144674.29.20Merge.20multiple.20suggestions.20into.20a.20single/near/539991695)
…henkov

Add test for derive helper compat collisions

Resolves rust-lang/reference#2055 (comment)

r? `@petrochenkov`
…, r=lolbinarycat

Fix invalid link generation for type alias methods

Fixes rust-lang#149205.

That one was quite the wild ride. First commit is the actual fix, the second commit is just a small name variable improvement while I was going through the code. Anyway, let's go through it:

 * We don't generate directly implementations in the HTML files for local impls (which I think is a mistake and should be changed, gonna do that as a follow-up) but instead generate a JS file for each type alias containing the HTML for these impls.
 * So in `write_shared.rs::TypeAliasPart::get`, when generating the JS file, we generate the impl into a `String` by calling `render_impl`. This method expects an `AssocItemLink` to help it generate the correct link to the item (I'm planning to also remove this enum because it's yet another way to generate anchors/hrefs).
 * Problem was: we call the `provided_trait_methods` method on the impl item... which is empty if not a trait impl. This becomes an issue when we arrive in `render::assoc_href_attr` because of this code:
     ```rust
            AssocItemLink::GotoSource(did, provided_methods) => {
                let item_type = match item_type {
                    ItemType::Method | ItemType::TyMethod => {
                        if provided_methods.contains(&name) {
                            ItemType::Method
                        } else {
                            ItemType::TyMethod
                        }
                    }
                    item_type => item_type,
                };
                // ...
            }
    ```

     Since `provided_methods` is always empty, it means all methods on type aliases will be `TyMethod`, generating `#tymethod.` URLs instead of `#method.`.
 * So generating `AssocItemLink::GoToSource` only on traits (when `provided_trait_methods` is supposed to return something) was the fix.
 * And finally, because it's (currently) generating implementations only through JS, it means we cannot test it in `tests/rustdoc` so I had to write the test in `tests/rustdoc-gui`. Once I change how we generate local implementations for type aliases, I'll move it to `tests/rustdoc`.

r? `@lolbinarycat`
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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. rollup A PR which is a rollup labels Nov 24, 2025
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Nov 24, 2025

📌 Commit e411480 has been approved by matthiaskrgr

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 24, 2025
bors added a commit that referenced this pull request Nov 24, 2025
Rollup of 3 pull requests

Successful merges:

 - #148652 (Cleanup and refactor FnCtxt::report_no_match_method_error)
 - #149200 (Add test for derive helper compat collisions)
 - #149274 (Fix invalid link generation for type alias methods)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Nov 24, 2025

⌛ Testing commit e411480 with merge 2f42bdc...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants