diff options
| author | Bastian Kauschke <bastian_kauschke@hotmail.de> | 2020-05-02 15:56:33 +0200 |
|---|---|---|
| committer | Who? Me?! <mark-i-m@users.noreply.github.com> | 2020-05-02 21:23:21 -0500 |
| commit | 3f7d16743cb3b35782e9c680e704276763aeb10e (patch) | |
| tree | 34f906882aeb52006c5f293a92b521a9be56bc59 /src/doc/rustc-dev-guide | |
| parent | 5ddf4f6ad1fe1285c4d5a1154e4d127709e8e3f6 (diff) | |
| download | rust-3f7d16743cb3b35782e9c680e704276763aeb10e.tar.gz rust-3f7d16743cb3b35782e9c680e704276763aeb10e.zip | |
Fix example for winnowing
Diffstat (limited to 'src/doc/rustc-dev-guide')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/traits/resolution.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/doc/rustc-dev-guide/src/traits/resolution.md b/src/doc/rustc-dev-guide/src/traits/resolution.md index 7f73bfe4f9d..236ca966d4b 100644 --- a/src/doc/rustc-dev-guide/src/traits/resolution.md +++ b/src/doc/rustc-dev-guide/src/traits/resolution.md @@ -191,12 +191,16 @@ trait Get { fn get(&self) -> Self; } -impl<T:Copy> Get for T { - fn get(&self) -> T { *self } +impl<T: Copy> Get for T { + fn get(&self) -> T { + *self + } } -impl<T:Get> Get for Box<T> { - fn get(&self) -> Box<T> { Box::new(get_it(&**self)) } +impl<T: Get> Get for Box<T> { + fn get(&self) -> Box<T> { + Box::new(<T>::get(self)) + } } ``` |
