diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2015-12-05 21:55:34 +0300 |
|---|---|---|
| committer | Aleksey Kladov <aleksey.kladov@gmail.com> | 2015-12-05 21:55:34 +0300 |
| commit | c8b7e24b142d5599f6f5eaefb0e98e7403b9b975 (patch) | |
| tree | d47fe53c8c0f04951233309ca7be5887294e0795 /src/doc/reference.md | |
| parent | 35decad78124b251822eb4666638455224d3f0c8 (diff) | |
| download | rust-c8b7e24b142d5599f6f5eaefb0e98e7403b9b975.tar.gz rust-c8b7e24b142d5599f6f5eaefb0e98e7403b9b975.zip | |
DOCS: update reference about paths
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 2ada86115b6..f5e367d6e5f 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -509,6 +509,25 @@ fn bar() { # fn main() {} ``` +Additionally keyword `super` may be repeated several times after the first +`super` or `self` to refer to ancestor modules. + +```rust +mod a { + fn foo() {} + + mod b { + mod c { + fn foo() { + super::super::foo(); // call a's foo function + self::super::super::foo(); // call a's foo function + } + } + } +} +# fn main() {} +``` + # Syntax extensions A number of minor features of Rust are not central enough to have their own |
