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

Const generic param disappears after rustfmt #124942

Closed
n3d-qmp opened this issue May 9, 2024 · 2 comments
Closed

Const generic param disappears after rustfmt #124942

n3d-qmp opened this issue May 9, 2024 · 2 comments
Labels
A-const-generics Area: const generics (parameters and arguments) A-rustfmt Area: Rustfmt C-bug Category: This is a bug. F-generic_const_items `#![feature(generic_const_items)]` requires-nightly This issue requires a nightly compiler in some way.

Comments

@n3d-qmp
Copy link

n3d-qmp commented May 9, 2024

I tried this code:

#![feature(generic_const_items)]
trait Trait {
    const N: isize;
}

const C<T: Trait>: isize = T::N;

After rustfmt generic param disappears:

#![feature(generic_const_items)]
trait Trait {
    const N: isize;
}

const C: isize = T::N;

Meta

rustc --version --verbose:
Tested on playground

@n3d-qmp n3d-qmp added the C-bug Category: This is a bug. label May 9, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 9, 2024
@n3d-qmp
Copy link
Author

n3d-qmp commented May 9, 2024

@rustbot label +requires-nightly +A-rustfmt +A-const-generics

@rustbot rustbot added A-const-generics Area: const generics (parameters and arguments) A-rustfmt Area: Rustfmt requires-nightly This issue requires a nightly compiler in some way. labels May 9, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 10, 2024
@fmease fmease added the F-generic_const_items `#![feature(generic_const_items)]` label May 10, 2024
@fmease
Copy link
Member

fmease commented May 10, 2024

In the future, please report rustfmt-specific issues over at rust-lang/rustfmt.

Duplicate of rust-lang/rustfmt#5995.

@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) A-rustfmt Area: Rustfmt C-bug Category: This is a bug. F-generic_const_items `#![feature(generic_const_items)]` requires-nightly This issue requires a nightly compiler in some way.
Projects
None yet
Development

No branches or pull requests

4 participants