diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-12-30 22:36:03 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2015-02-16 16:29:21 +0200 |
| commit | 4d8f995c3a482fecdb9a77455cd8d68d514d62ac (patch) | |
| tree | b0e8399e734c0be82e21481db5f3e5a28024caa2 /src/test/compile-fail/check-static-values-constraints.rs | |
| parent | 8dd1f6a0dc59236caffb483fdb0176df1945062f (diff) | |
| download | rust-4d8f995c3a482fecdb9a77455cd8d68d514d62ac.tar.gz rust-4d8f995c3a482fecdb9a77455cd8d68d514d62ac.zip | |
rustc: merge check_static into check_const.
Diffstat (limited to 'src/test/compile-fail/check-static-values-constraints.rs')
| -rw-r--r-- | src/test/compile-fail/check-static-values-constraints.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs index 7c4f9ada2d3..0180bccbca4 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/compile-fail/check-static-values-constraints.rs @@ -99,7 +99,7 @@ static STATIC10: UnsafeStruct = UnsafeStruct; struct MyOwned; static STATIC11: Box<MyOwned> = box MyOwned; -//~^ ERROR statics are not allowed to have custom pointers +//~^ ERROR allocations are not allowed in statics // The following examples test that mutable structs are just forbidden // to have types with destructors @@ -117,16 +117,17 @@ static mut STATIC14: SafeStruct = SafeStruct { //~^ ERROR mutable statics are not allowed to have destructors field1: SafeEnum::Variant1, field2: SafeEnum::Variant4("str".to_string()) +//~^ ERROR static contains unimplemented expression type }; static STATIC15: &'static [Box<MyOwned>] = &[ - box MyOwned, //~ ERROR statics are not allowed to have custom pointers - box MyOwned, //~ ERROR statics are not allowed to have custom pointers + box MyOwned, //~ ERROR allocations are not allowed in statics + box MyOwned, //~ ERROR allocations are not allowed in statics ]; static STATIC16: (&'static Box<MyOwned>, &'static Box<MyOwned>) = ( - &box MyOwned, //~ ERROR statics are not allowed to have custom pointers - &box MyOwned, //~ ERROR statics are not allowed to have custom pointers + &box MyOwned, //~ ERROR allocations are not allowed in statics + &box MyOwned, //~ ERROR allocations are not allowed in statics ); static mut STATIC17: SafeEnum = SafeEnum::Variant1; @@ -134,9 +135,9 @@ static mut STATIC17: SafeEnum = SafeEnum::Variant1; static STATIC19: Box<isize> = box 3; -//~^ ERROR statics are not allowed to have custom pointers +//~^ ERROR allocations are not allowed in statics pub fn main() { let y = { static x: Box<isize> = box 3; x }; - //~^ ERROR statics are not allowed to have custom pointers + //~^ ERROR allocations are not allowed in statics } |
