rustdoc: Add support for #[rustc_must_implement_one_of]#99235
rustdoc: Add support for #[rustc_must_implement_one_of]#99235bors merged 6 commits intorust-lang:masterfrom
#[rustc_must_implement_one_of]#99235Conversation
|
Some changes occurred in HTML/CSS themes. Some changes occurred in src/librustdoc/clean/types.rs cc @camelid Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @Folyd, @jsha A change occurred in the Ayu theme. cc @Cldfire |
|
(rust-highfive has picked a reviewer for you, use r? to override) |
src/librustdoc/clean/inline.rs
Outdated
There was a problem hiding this comment.
I wonder: if we have the trait DefId, I think most (if not all) other fields can be computed on demand, no?
There was a problem hiding this comment.
Probably? What is the purpose of clean types anyway? 🤔
There was a problem hiding this comment.
Types "cleaned up" for rustdoc use. :)
There was a problem hiding this comment.
It just feels (from an outside perspective) that a lot of this can be replaced by DefId newtypes + getters 😅
There was a problem hiding this comment.
unsafety or is_auto for example. :)
Well, can be done later on.
|
Also: please add a test in |
This comment has been minimized.
This comment has been minimized.
df48600 to
fd980c0
Compare
|
Took me a while to figure out how to do rustdoc tests, but I added the test 😄 |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
There can be one method right? If so, the s at the end of methods should be conditional.
There was a problem hiding this comment.
Also, can you add backticks around each method name please? Makes it easier to read it in a console.
There was a problem hiding this comment.
There can be one method right? If so, the s at the end of methods should be conditional.
No, there are always at least two methods.
There was a problem hiding this comment.
Oh indeed. So my first comment can be ignored. Remains the second one. ;)
There was a problem hiding this comment.
Like that a81b4304e0d5668e74fd62443faf44da8a2083c8?
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
You need to add this into ayu.css as well.
There was a problem hiding this comment.
It was already there though. Adding .stab.must_implement{} fixed the issue, seems like a bug in the checker...
There was a problem hiding this comment.
No, the rule isn't the same so to speak. They needed to be all split (hence why it was unhappy). The joy of CSS. :)
|
Looks all good to me. Please add the missing CSS rule in the ayu theme and it should be good to go! |
|
☔ The latest upstream changes (presumably #99598) made this pull request unmergeable. Please resolve the merge conflicts. |
a81b430 to
7f1af42
Compare
This comment has been minimized.
This comment has been minimized.
|
Can someone explain why the tests fail/how to fix them? I don't really get gui tests 😅 |
|
All the GUI tests are failing because there is a change in the body width. Basically, you broke the layout. 😆 |
|
Thanks! @bors r+ rollup |
…askrgr Rollup of 6 pull requests Successful merges: - rust-lang#99235 (rustdoc: Add support for `#[rustc_must_implement_one_of]`) - rust-lang#99716 (remove useless mut from examples) - rust-lang#99724 (Fix some broken link fragments.) - rust-lang#99729 (Remove unused tuple fields) - rust-lang#99757 (Make `transmute_copy` docs read better) - rust-lang#99758 (remove useless `#[allow]` in a test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup

This PR adds support for
#[rustc_must_implement_one_of]attribute added in #92164. There is a desire to eventually use this attribute ofRead, so making it show up in docs is a good thing.I "stole" the styling from cfg notes, not sure what would be a proper styling. Currently it looks like this:

Code to reproduce