about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-11-01 22:56:36 +0800
committerkennytm <kennytm@gmail.com>2018-11-01 22:56:36 +0800
commitf76a8e3b86c8a6b12820103c5cefb251b0c6282c (patch)
tree9fa700761935bffd0a8c38df7f6830a27950d9ba /src
parent1a25f22c801ffb277385f76c494634f388343fb0 (diff)
parent0d38b0ec9a47cf571ab2af1ca6456593e174e678 (diff)
downloadrust-f76a8e3b86c8a6b12820103c5cefb251b0c6282c.tar.gz
rust-f76a8e3b86c8a6b12820103c5cefb251b0c6282c.zip
Rollup merge of #55578 - regexident:fix/self, r=frewsxcv
Made doc example of `impl Default for …` use `-> Self` instead of explicit self type

There is no need to state the explicit type of `self`.
Diffstat (limited to 'src')
-rw-r--r--src/libcore/default.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/default.rs b/src/libcore/default.rs
index ab36e29b1e1..638acebd617 100644
--- a/src/libcore/default.rs
+++ b/src/libcore/default.rs
@@ -76,7 +76,7 @@
 /// }
 ///
 /// impl Default for Kind {
-///     fn default() -> Kind { Kind::A }
+///     fn default() -> Self { Kind::A }
 /// }
 /// ```
 ///
@@ -118,7 +118,7 @@ pub trait Default: Sized {
     /// }
     ///
     /// impl Default for Kind {
-    ///     fn default() -> Kind { Kind::A }
+    ///     fn default() -> Self { Kind::A }
     /// }
     /// ```
     #[stable(feature = "rust1", since = "1.0.0")]