rust/tests/ui/issues/issue-25901.rs

15 lines
217 B
Rust
Raw Normal View History

struct A;
struct B;
static S: &'static B = &A;
2023-04-16 06:12:37 -05:00
//~^ 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(){}