]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-87295.rs
Merge commit '266e96785ab71834b917bf474f130a6d8fdecd4b' into sync_cg_clif-2022-10-23
[rust.git] / src / test / ui / impl-trait / issues / issue-87295.rs
1 trait Trait {
2     type Output;
3 }
4 impl Trait for () {
5     type Output = i32;
6 }
7
8 struct Struct<F>(F);
9 impl<F> Struct<F> {
10     pub fn new(_: F) -> Self {
11         todo!()
12     }
13 }
14
15 fn main() {
16     let _do_not_waste: Struct<impl Trait<Output = i32>> = Struct::new(());
17     //~^ `impl Trait` only allowed in function and inherent method return types
18 }