]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #55485 - petertodd:2018-10-manuallydrop-deref, r=TimNN
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 22 Nov 2018 09:37:45 +0000 (10:37 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Nov 2018 09:37:45 +0000 (10:37 +0100)
commit1c57f0ab9c58d8394b531de15423fbb4c57a2613
tree8af1b6d0306c8dd7c0500f364dd2c885000cde77
parent9aedfd5a3bb4e4b4d900cf19780f8ed892c92af0
parentbc1885703cb46a462a4be1eea7c4e0f9abbe7a95
Rollup merge of #55485 - petertodd:2018-10-manuallydrop-deref, r=TimNN

Return &T / &mut T in ManuallyDrop Deref(Mut) impl

Without this change the generated documentation looks like this:

    fn deref(&self) -> &<ManuallyDrop<T> as Deref>::Target

Returning the actual type directly makes the generated docs more clear:

    fn deref(&self) -> &T

Basically, compare how the impl for `Box<T>` and `ManuallyDrop<T>` looks in this screenshot:

![rust docs for ManuallyDrop as Deref](https://user-images.githubusercontent.com/7042/47673083-fc9dc280-db89-11e8-89b0-c6bde663feef.png)
src/libcore/mem.rs