mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
18 lines
190 B
Rust
18 lines
190 B
Rust
|
//@ check-pass
|
||
|
use std::borrow::Borrow;
|
||
|
|
||
|
struct S;
|
||
|
|
||
|
trait T: Sized {
|
||
|
fn foo(self) {}
|
||
|
}
|
||
|
|
||
|
impl T for S {}
|
||
|
impl T for &S {}
|
||
|
|
||
|
fn main() {
|
||
|
let s = S;
|
||
|
s.borrow().foo();
|
||
|
s.foo();
|
||
|
}
|