//@ known-bug: #114212 #![feature(generic_const_exprs)] use core::marker::PhantomData; pub const DEFAULT_MAX_INPUT_LEN: usize = 256; pub trait FooTrait {} pub struct Foo; impl FooTrait for Foo {} pub struct Bar< const MAX_INPUT_LEN: usize = DEFAULT_MAX_INPUT_LEN, PB = Foo, > where PB: FooTrait, { _pb: PhantomData, } impl Bar where PB: FooTrait, { pub fn new() -> Self { Self { _pb: PhantomData, } } }