diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-07-25 19:29:48 +0200 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-07-25 19:29:48 +0200 |
| commit | b75dfa8a2bac745d7d09212e3e28cb4f0bc28fdf (patch) | |
| tree | 23b4a57b801ebd793ef3eb09c191833eedbe0905 /src/test | |
| parent | eedf6ce4ef54bb03818ab21d714f1b9f13a6b31c (diff) | |
| download | rust-b75dfa8a2bac745d7d09212e3e28cb4f0bc28fdf.tar.gz rust-b75dfa8a2bac745d7d09212e3e28cb4f0bc28fdf.zip | |
Don't access a static just for its size and alignment
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/static-cycle-error.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/consts/static-cycle-error.rs b/src/test/ui/consts/static-cycle-error.rs new file mode 100644 index 00000000000..9ce050aae21 --- /dev/null +++ b/src/test/ui/consts/static-cycle-error.rs @@ -0,0 +1,11 @@ +// check-pass + +struct Foo { + foo: Option<&'static Foo> +} + +static FOO: Foo = Foo { + foo: Some(&FOO), +}; + +fn main() {} |
