Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move emit_stashed_diagnostic call in rustfmt. #121615

Merged
merged 1 commit into from
Feb 26, 2024

Commits on Feb 25, 2024

  1. Move emit_stashed_diagnostic call in rustfmt.

    This call was added to `parse_crate_mod` in rust-lang#121487, to fix a case where
    a stashed diagnostic wasn't emitted. But there is another path where a
    stashed diagnostic might fail to be emitted if there's a parse error, if
    the `build` call in `parse_crate_inner` fails before `parse_crate_mod`
    is reached.
    
    So this commit moves the `emit_stashed_diagnostic` call outwards, from
    `parse_crate_mod` to `format_project`, just after the
    `Parser::parse_crate` call. This should be far out enough to catch any
    parsing errors.
    
    Fixes rust-lang#121517.
    nnethercote committed Feb 25, 2024
    Configuration menu
    Copy the full SHA
    bf7d1b5 View commit details
    Browse the repository at this point in the history