Skip to content

use path and documentation #70880

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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