]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25901.rs
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-25901.rs
1 struct A;
2 struct B;
3
4 static S: &'static B = &A;
5 //~^ ERROR calls in statics are limited to constant functions
6
7 use std::ops::Deref;
8
9 impl Deref for A {
10     type Target = B;
11     fn deref(&self)->&B { static B_: B = B; &B_ }
12 }
13
14 fn main(){}