Skip to content

Allow const parameters in for<>#1907

Merged
dtolnay merged 1 commit into
masterfrom
forconst
Aug 15, 2025
Merged

Allow const parameters in for<>#1907
dtolnay merged 1 commit into
masterfrom
forconst

Conversation

@dtolnay

@dtolnay dtolnay commented Aug 15, 2025

Copy link
Copy Markdown
Owner

This seems harmless to allow syntactically. Rustc does as well, since Rust 1.51:

pub trait Trait<const K: usize> {}

#[cfg(any())]
fn f(_: impl for<const K: usize> Trait<K>) {}

@dtolnay dtolnay merged commit 60de331 into master Aug 15, 2025
30 checks passed
@dtolnay dtolnay deleted the forconst branch August 15, 2025 21:31
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 this pull request may close these issues.

1 participant