2015-07-07 10:45:52 -05:00
|
|
|
struct A;
|
|
|
|
struct B;
|
|
|
|
|
2016-05-02 17:57:35 -05:00
|
|
|
static S: &'static B = &A;
|
2023-04-16 06:12:37 -05:00
|
|
|
//~^ ERROR cannot perform deref coercion
|
2015-07-07 10:45:52 -05:00
|
|
|
|
|
|
|
use std::ops::Deref;
|
|
|
|
|
|
|
|
impl Deref for A {
|
|
|
|
type Target = B;
|
|
|
|
fn deref(&self)->&B { static B_: B = B; &B_ }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main(){}
|