mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
21 lines
232 B
Rust
21 lines
232 B
Rust
// run-pass
|
|
trait Foo: Sized {
|
|
fn foo(self) {}
|
|
}
|
|
|
|
trait Bar: Sized {
|
|
fn bar(self) {}
|
|
}
|
|
|
|
struct S;
|
|
|
|
impl<'l> Foo for &'l S {}
|
|
|
|
impl<T: Foo> Bar for T {}
|
|
|
|
fn main() {
|
|
let s = S;
|
|
s.foo();
|
|
(&s).bar();
|
|
s.bar();
|
|
}
|