]> git.lizzy.rs Git - rust.git/commitdiff
Note ::foo::bar() in the crates guide
authorSteve Klabnik <steve@steveklabnik.com>
Thu, 19 Mar 2015 00:24:22 +0000 (20:24 -0400)
committerManish Goregaokar <manishsmail@gmail.com>
Thu, 19 Mar 2015 02:54:42 +0000 (08:24 +0530)
Fixes #21589

src/doc/trpl/crates-and-modules.md

index f6f6046b9b458367045dc12350613a223ec6eeaa..65ff42ffdcef411804fc99d4a1967b1632d0a637 100644 (file)
@@ -562,6 +562,11 @@ place in the hierarchy instead. There's one more special form of `use`: you can
 people like to think of `self` as `.` and `super` as `..`, from many shells'
 display for the current directory and the parent directory.
 
+Outside of `use`, paths are relative: `foo::bar()` refers to a function inside
+of `foo` relative to where we are. If that's prefixed with `::`, as in
+`::foo::bar()`, it refers to a different `foo`, an absolute path from your
+crate root.
+
 Also, note that we `pub use`d before we declared our `mod`s. Rust requires that
 `use` declarations go first.