about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-16 17:14:16 +0000
committerbors <bors@rust-lang.org>2022-05-16 17:14:16 +0000
commitda503b6a1349b1402bfc9e2d109c7c16b3e9b9f4 (patch)
tree3262f8222953977d0a8c173e1794eb11663da7ba /src/test/codegen/src-hash-algorithm
parent825ce48180bb9344a198df9361bd43a40b5b13d4 (diff)
parentf1b6e45fbacc8683a0a7da6e338261b943188849 (diff)
downloadrust-da503b6a1349b1402bfc9e2d109c7c16b3e9b9f4.tar.gz
rust-da503b6a1349b1402bfc9e2d109c7c16b3e9b9f4.zip
Auto merge of #12274 - jonas-schievink:move-getter-docs-generation, r=jonas-schievink
feat: Handle getters and setters in documentation template assist

The assist can now turn this:

```rust
pub struct S;
impl S {
    pub fn data_mut$0(&mut self) -> &mut [u8] { &mut [] }
}
```

into

```rust
pub struct S;
impl S {
    /// Returns a mutable reference to the data.
    ///
    /// # Examples
    ///
    /// ```
    /// use test::S;
    ///
    /// let mut s = ;
    /// assert_eq!(s.data_mut(), );
    /// assert_eq!(s, );
    /// ```
    pub fn data_mut(&mut self) -> &mut [u8] { &mut [] }
}
```

And similarly for by-value or immutable getters, and for setters. Previously the intro line would be empty.

This PR also removes the documentation generation function from the "Generate getter/setter" assist, since that is better handled by applying the 2 assists in sequence. cc https://github.com/rust-lang/rust-analyzer/issues/12273
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions