Skip to content

Commit c8b7e24

Browse files
committed
DOCS: update reference about paths
1 parent 35decad commit c8b7e24

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/doc/reference.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,25 @@ fn bar() {
509509
# fn main() {}
510510
```
511511

512+
Additionally keyword `super` may be repeated several times after the first
513+
`super` or `self` to refer to ancestor modules.
514+
515+
```rust
516+
mod a {
517+
fn foo() {}
518+
519+
mod b {
520+
mod c {
521+
fn foo() {
522+
super::super::foo(); // call a's foo function
523+
self::super::super::foo(); // call a's foo function
524+
}
525+
}
526+
}
527+
}
528+
# fn main() {}
529+
```
530+
512531
# Syntax extensions
513532

514533
A number of minor features of Rust are not central enough to have their own

0 commit comments

Comments
 (0)