Skip to content

Update default edition to 2018 #3517

Closed
@dtolnay

Description

@dtolnay

The current behavior of rustfmt as of 8ec0750 is:

$ echo 'use ::serde::Serialize; mod serde {}' | cargo run --bin rustfmt

use serde::Serialize;
mod serde {}

That is, by default the rustfmt cli command is assuming edition 2015. This assumption actually breaks the meaning of some 2018 style imports as seen in #3501.

Quoting from @topecongiro in #3501 (comment):

As the default edition of rustc and cargo are both 2018, I think it's reasonable to change the default edition of rustfmt to 2018 in 2.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions