]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #99235 - WaffleLapkin:rustdoc_implement_support_for_must_implement...
authorMatthias Krüger <matthias.krueger@famsik.de>
Tue, 26 Jul 2022 14:57:46 +0000 (16:57 +0200)
committerGitHub <noreply@github.com>
Tue, 26 Jul 2022 14:57:46 +0000 (16:57 +0200)
rustdoc: Add support for `#[rustc_must_implement_one_of]`

This PR adds support for `#[rustc_must_implement_one_of]` attribute added in #92164. There is a desire to eventually use this attribute of `Read`, 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:
![2022-07-14_15-00](https://user-images.githubusercontent.com/38225716/178968170-913c1dd5-8875-4a95-9848-b075a0bb8998.png)

<details><summary>Code to reproduce</summary>
<p>

```rust
#![feature(rustc_attrs)]

#[rustc_must_implement_one_of(a, b)]
pub trait Trait {
    fn req();
    fn a(){ Self::b() }
    fn b(){ Self::a() }
}
```

</p>
</details>

1  2 
src/librustdoc/clean/mod.rs

Simple merge