]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/dyn-trait-elided-two-inputs-assoc.rs
Rollup merge of #98441 - calebzulawski:simd_as, r=oli-obk
[rust.git] / src / test / ui / impl-trait / dyn-trait-elided-two-inputs-assoc.rs
1 // Test that we don't get an error with `dyn Bar` in an impl Trait
2 // when there are multiple inputs.  The `dyn Bar` should default to `+
3 // 'static`. This used to erroneously generate an error (cc #62517).
4 //
5 // check-pass
6
7 trait Foo { type Item: ?Sized; }
8 trait Bar { }
9
10 impl<T> Foo for T {
11     type Item = dyn Bar;
12 }
13
14 fn foo(x: &str, y: &str) -> impl Foo<Item = dyn Bar> { () }
15
16 fn main() { }