2021-07-22 13:16:33 -05:00
|
|
|
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(());
|
2022-02-17 21:18:42 -06:00
|
|
|
//~^ `impl Trait` only allowed in function and inherent method return types
|
2021-07-22 13:16:33 -05:00
|
|
|
}
|