diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-05-03 01:57:35 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-05-07 19:14:32 +0300 |
| commit | 4f5900aefac42cec488a68c041ecd538c04b84fd (patch) | |
| tree | a27eb77ecb3c2e47bcb8924c18329c2e0cb66901 /src/test/compile-fail/static-array-across-crate.rs | |
| parent | 78884b765915c551e5f3fe71b185d91ec4c186de (diff) | |
| download | rust-4f5900aefac42cec488a68c041ecd538c04b84fd.tar.gz rust-4f5900aefac42cec488a68c041ecd538c04b84fd.zip | |
test: adjust for the move to MIR-based const checking.
Diffstat (limited to 'src/test/compile-fail/static-array-across-crate.rs')
| -rw-r--r-- | src/test/compile-fail/static-array-across-crate.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/test/compile-fail/static-array-across-crate.rs b/src/test/compile-fail/static-array-across-crate.rs index 04a731e847a..d101432f6d1 100644 --- a/src/test/compile-fail/static-array-across-crate.rs +++ b/src/test/compile-fail/static-array-across-crate.rs @@ -17,4 +17,11 @@ use array::ARRAY; static X: &'static u8 = &ARRAY[0]; //~^ ERROR: cannot refer to the interior of another static, use a constant +static Y: &'static u8 = &(&ARRAY)[0]; +//~^ ERROR: cannot refer to the interior of another static, use a constant + +static Z: u8 = (&ARRAY)[0]; +//~^ ERROR: cannot refer to the interior of another static, use a constant +//~^^ ERROR: cannot refer to other statics by value + pub fn main() {} |
