Refactor ty_str to use a ~(str) representation.

Similar to my recent changes to ~[T]/&[T], these changes remove the vstore abstraction and represent str types as ~(str) and &(str). The Option<uint> in ty_str is the length of the string, None if the string is dynamically sized.
This commit is contained in:
Nick Cameron 2014-04-27 10:19:15 +12:00
parent 7a19a82d11
commit c0ff3caae1
29 changed files with 322 additions and 512 deletions

View file

@ -17,7 +17,7 @@ fn has_uniq(x: ~str) {
}
fn has_slice(x: &str) {
wants_uniq(x); //~ ERROR str storage differs: expected `~` but found `&`
wants_uniq(x); //~ ERROR mismatched types: expected `~str` but found `&str` (expected ~-ptr but f
wants_slice(x);
}

View file

@ -10,5 +10,5 @@
fn main() {
format!("{0, select, other{}}", 2);
//~^ ERROR: expected &str but found integral
//~^ ERROR: mismatched types: expected `&&str` but found `&<generic integer #0>` (expected &-ptr
}