rust/tests/ui/impl-trait/issues/issue-87295.rs
2024-01-07 18:00:03 +00:00

19 lines
335 B
Rust

trait Trait {
type Output;
}
impl Trait for () {
type Output = i32;
}
struct Struct<F>(F);
impl<F> Struct<F> {
pub fn new(_: F) -> Self {
todo!()
}
}
fn main() {
let _do_not_waste: Struct<impl Trait<Output = i32>> = Struct::new(());
//~^ `impl Trait` is not allowed in the type of variable bindings
}