Skip to content

Using absolute paths from std combined with no_implicit_prelude has no edition 2018 compat warning #56390

Open
@Nemo157

Description

@Nemo157

This code compiles without warning on edition 2015 with #![warn(rust_2018_compatibility)] active, but fails to build on edition 2018 (playground):

#![no_implicit_prelude]

#![warn(rust_2018_compatibility)]

fn main() {
    std::process::exit(0);
}

error:

error[E0433]: failed to resolve: use of undeclared type or module `std`
 --> src/main.rs:6:5
  |
6 |     std::process::exit(0);
  |     ^^^ use of undeclared type or module `std`

Note: changing the path to instead use ::std::process::exit compiles on both editions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2018Area: The 2018 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions