rust/tests/ui/impl-trait/issues/issue-87295.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
358 B
Rust
Raw Normal View History

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(());
2023-10-04 14:51:43 -05:00
//~^ `impl Trait` only allowed in function and inherent method argument and return types
}