mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
18 lines
238 B
Rust
18 lines
238 B
Rust
// build-pass
|
|
|
|
trait FooTrait {}
|
|
|
|
trait BarTrait {
|
|
fn foo<T: FooTrait>(_: T) -> Self;
|
|
}
|
|
|
|
struct FooStruct(u32);
|
|
|
|
impl BarTrait for FooStruct {
|
|
fn foo<T: FooTrait>(_: T) -> Self {
|
|
Self(u32::default())
|
|
}
|
|
}
|
|
|
|
fn main() {}
|