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

rustfmt generates invalid code with for const int generic with default argument #5935

Closed
krh opened this issue Oct 8, 2023 · 0 comments · Fixed by #5936
Closed

rustfmt generates invalid code with for const int generic with default argument #5935

krh opened this issue Oct 8, 2023 · 0 comments · Fixed by #5936

Comments

@krh
Copy link

krh commented Oct 8, 2023

This struct

struct Regs<
    const BEGIN: u64,
    const END: u64,
    const DIM: usize,
    const N: usize = { (END - BEGIN) as usize / (8 * DIM) + 1 },
>
{
    _foo: u64,
}

gets reformatted to

struct Regs<
    const BEGIN: u64,
    const END: u64,
    const DIM: usize,
    const N: usize = { (END - BEGIN) as usize / (8 * DIM) + 1 },
>
{ (END - BEGIN) as usize / (8 * DIM) + 1 },
>
{
    _foo: u64,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant