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

use path and documentation #70880

Closed
montag451 opened this issue Apr 7, 2020 · 1 comment
Closed

use path and documentation #70880

montag451 opened this issue Apr 7, 2020 · 1 comment

Comments

@montag451
Copy link

Hi,

In the chapter about use declarations in The Reference book (https://doc.rust-lang.org/reference/items/use-declarations.html#use-paths), the book states that:

Paths in use items must start with a crate name or one of the path qualifiers crate, self, super, or ::.

It then gives a code snippet with examples of what is allowed and what is not. In particular the line:

//  use example::iter;      // bad: relative paths are not allowed without `self`

is commented out because it shouldn't compile but when I tried to compile the snippet on the playground with the line uncommented, the compilation was successful (using 2018 edition).

Am I wrong or the book contains an error?

@ehuss
Copy link
Contributor

ehuss commented Apr 7, 2020

No, the reference is wrong. We have a few PRs open to change it (rust-lang/reference#665 and rust-lang/reference#697), but haven't gotten it updated.

I'm going to close, as this is a known issue. In the future, if you find any problems with the reference, it is best to file against the reference issue tracker at https://github.com/rust-lang/reference/issues.

@ehuss ehuss closed this as completed Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants