Skip to content

Allow for missing modules #5962

Closed as not planned
Closed as not planned
@abrisco

Description

@abrisco

I have a crate that uses some generated source code that fails whenever I run rustfmt before generating it with the following error

~/Code/rustfmthing (main ✗) rustfmt ./src/main.rs
Error writing files: failed to resolve mod `generated`: /Users/abrisco/Code/rustfmthing/src/generated.rs does not exist

The source file looks like this:

mod generated;

pub fn main() {
    generated::greeting();
}

Is there a way to have rustfmt not attempt to resolve modules and instead simply format the file I passed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions