Skip to content

Utilizing Display on a Path could suggest calling display() #38997

Closed
@jrmuizel

Description

@jrmuizel
    let path = Path::new("/tmp/foo/bar.txt");
    println!("{}", path);

gives

  = note: `std::path::Path` cannot be formatted with the default formatter; try using `:?` instead if you are using a format string
  = note: required because of the requirements on the impl of `std::fmt::Display` for `&std::path::Path`
  = note: required by `std::fmt::Display::fmt`

It would be nice if rustc suggested calling display() on the path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions