From 331ce5b2badc3ab8bf74b4a7e746bb4ce79bd27d Mon Sep 17 00:00:00 2001 From: king6cong Date: Thu, 26 Dec 2019 15:26:52 +0800 Subject: [PATCH] Do not limit `Self` usage in trait implementation e.g. the following `Self` usage is valid ```rust struct S { s: Option> } ; impl S { pub fn new() -> Self { S { s: None } } } ``` --- src/appendix-01-keywords.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/appendix-01-keywords.md b/src/appendix-01-keywords.md index 6a129e290..c74741767 100644 --- a/src/appendix-01-keywords.md +++ b/src/appendix-01-keywords.md @@ -40,7 +40,7 @@ The following keywords currently have the functionality described. * `pub` - denote public visibility in struct fields, `impl` blocks, or modules * `ref` - bind by reference * `return` - return from function -* `Self` - a type alias for the type implementing a trait +* `Self` - a type alias for the type we are defining or implementing * `self` - method subject or current module * `static` - global variable or lifetime lasting the entire program execution * `struct` - define a structure