Skip to content

use path and documentation #70880

Closed
Closed
@montag451

Description

@montag451

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions