From c8b7e24b142d5599f6f5eaefb0e98e7403b9b975 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 5 Dec 2015 21:55:34 +0300 Subject: [PATCH] DOCS: update reference about paths --- src/doc/reference.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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