diff options
| author | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2018-12-28 20:05:22 +0100 |
|---|---|---|
| committer | Oliver Scherer <github35764891676564198441@oli-obk.de> | 2019-01-09 10:20:12 +0100 |
| commit | 4b4fc63eb7745639c76c1f8011239354a1823547 (patch) | |
| tree | c505539d763b2879049ee5fe08cb1667da319685 /src/test/ui/check-static-values-constraints.rs | |
| parent | 167ceff01ec2f01f677fa6351646255d3dacbb98 (diff) | |
| download | rust-4b4fc63eb7745639c76c1f8011239354a1823547.tar.gz rust-4b4fc63eb7745639c76c1f8011239354a1823547.zip | |
Stabilize `let` bindings and destructuring in constants and const fn
Diffstat (limited to 'src/test/ui/check-static-values-constraints.rs')
| -rw-r--r-- | src/test/ui/check-static-values-constraints.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/test/ui/check-static-values-constraints.rs b/src/test/ui/check-static-values-constraints.rs index eb0fc39e1bf..acfb3b5e44b 100644 --- a/src/test/ui/check-static-values-constraints.rs +++ b/src/test/ui/check-static-values-constraints.rs @@ -78,6 +78,7 @@ struct MyOwned; static STATIC11: Box<MyOwned> = box MyOwned; //~^ ERROR allocations are not allowed in statics +//~| ERROR static contains unimplemented expression type static mut STATIC12: UnsafeStruct = UnsafeStruct; @@ -92,12 +93,16 @@ static mut STATIC14: SafeStruct = SafeStruct { static STATIC15: &'static [Box<MyOwned>] = &[ box MyOwned, //~ ERROR allocations are not allowed in statics + //~| ERROR contains unimplemented expression box MyOwned, //~ ERROR allocations are not allowed in statics + //~| ERROR contains unimplemented expression ]; static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) = ( &box MyOwned, //~ ERROR allocations are not allowed in statics + //~| ERROR contains unimplemented expression &box MyOwned, //~ ERROR allocations are not allowed in statics + //~| ERROR contains unimplemented expression ); static mut STATIC17: SafeEnum = SafeEnum::Variant1; @@ -105,9 +110,11 @@ static mut STATIC17: SafeEnum = SafeEnum::Variant1; static STATIC19: Box<isize> = box 3; //~^ ERROR allocations are not allowed in statics + //~| ERROR contains unimplemented expression pub fn main() { let y = { static x: Box<isize> = box 3; x }; //~^ ERROR allocations are not allowed in statics - //~^^ ERROR cannot move out of static item + //~| ERROR cannot move out of static item + //~| ERROR contains unimplemented expression } |
