diff options
| author | Richo Healey <richo@psych0tik.net> | 2014-04-15 18:17:48 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2014-04-18 17:25:34 -0700 |
| commit | 919889a1d688a6bbe2edac8705f048f06b1b455c (patch) | |
| tree | 322a69fa39bdaf37bbfffc84020acbd4c87871d0 /src/test/compile-fail/check-static-values-constraints.rs | |
| parent | b75683cadf6c4c55360202cd6a0106be80532451 (diff) | |
| download | rust-919889a1d688a6bbe2edac8705f048f06b1b455c.tar.gz rust-919889a1d688a6bbe2edac8705f048f06b1b455c.zip | |
Replace all ~"" with "".to_owned()
Diffstat (limited to 'src/test/compile-fail/check-static-values-constraints.rs')
| -rw-r--r-- | src/test/compile-fail/check-static-values-constraints.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/compile-fail/check-static-values-constraints.rs index f4e9521d6b6..a8581534848 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/compile-fail/check-static-values-constraints.rs @@ -92,7 +92,9 @@ impl Drop for UnsafeStruct { static STATIC10: UnsafeStruct = UnsafeStruct; //~^ ERROR static items are not allowed to have destructor -static STATIC11: ~str = ~"Owned pointers are not allowed either"; +struct MyOwned; + +static STATIC11: ~MyOwned = ~MyOwned; //~^ ERROR static items are not allowed to have owned pointers // The following examples test that mutable structs are just forbidden @@ -104,14 +106,14 @@ static mut STATIC12: UnsafeStruct = UnsafeStruct; static mut STATIC13: SafeStruct = SafeStruct{field1: Variant1, field2: Variant3(WithDtor)}; //~^ ERROR mutable static items are not allowed to have destructors -static mut STATIC14: SafeStruct = SafeStruct{field1: Variant1, field2: Variant4(~"str")}; +static mut STATIC14: SafeStruct = SafeStruct{field1: Variant1, field2: Variant4("str".to_owned())}; //~^ ERROR mutable static items are not allowed to have destructors -static STATIC15: &'static [~str] = &'static [~"str", ~"str"]; +static STATIC15: &'static [~MyOwned] = &'static [~MyOwned, ~MyOwned]; //~^ ERROR static items are not allowed to have owned pointers //~^^ ERROR static items are not allowed to have owned pointers -static STATIC16: (~str, ~str) = (~"str", ~"str"); +static STATIC16: (&'static ~MyOwned, &'static ~MyOwned) = (&'static ~MyOwned, &'static ~MyOwned); //~^ ERROR static items are not allowed to have owned pointers //~^^ ERROR static items are not allowed to have owned pointers |
