Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.32: Starting relative paths with self when specified after use already not necessary. #1807

Closed
santids opened this issue Feb 8, 2019 · 4 comments
Labels
blocked Blocked on a change we need to make in this repo

Comments

@santids
Copy link

santids commented Feb 8, 2019

Hi There! New to the community.

Reading the book I found this line and decided to try it.

Starting relative paths with self when specified after use might not be neccesary in the future; it’s an inconsistency in the language that people are working on eliminating.

open https://doc.rust-lang.org/book/ch07-02-modules-and-use-to-control-scope-and-privacy.html

Using rustc version 1.32.0 (9fda7c223 2019-01-16), the self keyboard is already not necessary.

The following code compiles without errors

mod sound {
    pub mod instrument {
        pub fn clarinet () {
            super::voice::sing();
            println!("clarinet");

        }
    }

    pub mod voice {
        pub fn sing () {

        }
    }

}

use sound::instrument;
use self::sound::instrument;
@carols10cents
Copy link
Member

Yes, the book is currently frozen at 1.31. We will update this when the book moves to 1.32. Thanks!

@carols10cents carols10cents changed the title Starting relative paths with self when specified after use already not necessary. 1.32: Starting relative paths with self when specified after use already not necessary. Feb 8, 2019
@carols10cents carols10cents added the blocked Blocked on a change we need to make in this repo label Feb 17, 2019
@varnie
Copy link

varnie commented Feb 19, 2019

btw, there's a typo: "neccesary" there.

@goelakash
Copy link

goelakash commented Apr 28, 2019

btw, there's a typo: "neccesary" there.

There's no such typo in the book.
https://doc.rust-lang.org/book/ch07-02-modules-and-use-to-control-scope-and-privacy.html

@steveklabnik
Copy link
Member

Turns out #1820 fixed this. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on a change we need to make in this repo
Projects
None yet
Development

No branches or pull requests

5 participants