mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
15 lines
217 B
Rust
15 lines
217 B
Rust
struct A;
|
|
struct B;
|
|
|
|
static S: &'static B = &A;
|
|
//~^ ERROR cannot perform deref coercion
|
|
|
|
use std::ops::Deref;
|
|
|
|
impl Deref for A {
|
|
type Target = B;
|
|
fn deref(&self)->&B { static B_: B = B; &B_ }
|
|
}
|
|
|
|
fn main(){}
|