Don't access a static just for its size and alignment
This commit is contained in:
parent
eedf6ce4ef
commit
b75dfa8a2b
2 changed files with 24 additions and 14 deletions
11
src/test/ui/consts/static-cycle-error.rs
Normal file
11
src/test/ui/consts/static-cycle-error.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// check-pass
|
||||
|
||||
struct Foo {
|
||||
foo: Option<&'static Foo>
|
||||
}
|
||||
|
||||
static FOO: Foo = Foo {
|
||||
foo: Some(&FOO),
|
||||
};
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue