auto merge of #16575 : pcwalton/rust/import-foo-as-bar, r=aturon
of `use bar as foo`. Change all uses of `use foo = bar` to `use bar as foo`. Implements RFC #47. Closes #16461. [breaking-change] r? @aturon
This commit is contained in:
commit
98ec85f19e
62 changed files with 140 additions and 136 deletions
|
|
@ -1801,7 +1801,7 @@ module through the rules above. It essentially allows public access into the
|
|||
re-exported item. For example, this program is valid:
|
||||
|
||||
~~~~
|
||||
pub use api = self::implementation;
|
||||
pub use self::implementation as api;
|
||||
|
||||
mod implementation {
|
||||
pub fn f() {}
|
||||
|
|
|
|||
|
|
@ -3112,7 +3112,7 @@ use farm::*;
|
|||
However, that's not all. You can also rename an item while you're bringing it into scope:
|
||||
|
||||
~~~
|
||||
use egg_layer = farm::chicken;
|
||||
use farm::chicken as egg_layer;
|
||||
# mod farm { pub fn chicken() { println!("Laying eggs is fun!") } }
|
||||
// ...
|
||||
|
||||
|
|
@ -3335,7 +3335,7 @@ you just have to import it with an `use` statement.
|
|||
For example, it re-exports `range` which is defined in `std::iter::range`:
|
||||
|
||||
~~~
|
||||
use iter_range = std::iter::range;
|
||||
use std::iter::range as iter_range;
|
||||
|
||||
fn main() {
|
||||
// `range` is imported by default
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue