Skip to content

Commit 7b26503

Browse files
committed
Make str be treated as str/~.
1 parent b569bde commit 7b26503

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/rustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ fn mk_mach_float(cx: ctxt, tm: ast::float_ty) -> t { mk_t(cx, ty_float(tm)) }
652652

653653
fn mk_char(cx: ctxt) -> t { mk_t(cx, ty_int(ast::ty_char)) }
654654

655-
fn mk_str(cx: ctxt) -> t { mk_t(cx, ty_str) }
655+
fn mk_str(cx: ctxt) -> t { mk_estr(cx, vstore_uniq) }
656656

657657
fn mk_estr(cx: ctxt, t: vstore) -> t {
658658
mk_t(cx, ty_estr(t))

src/rustc/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ fn arg_is_argv_ty(_tcx: ty::ctxt, a: ty::arg) -> bool {
223223
ty::ty_evec(mt, vstore_uniq) {
224224
if mt.mutbl != ast::m_imm { ret false; }
225225
alt ty::get(mt.ty).struct {
226-
ty::ty_str { ret true; }
226+
ty::ty_estr(vstore_uniq) { ret true; }
227227
_ { ret false; }
228228
}
229229
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern:expected `str` but found `int`
1+
// error-pattern:expected `str/~` but found `int`
22

33
const i: str = 10i;
44
fn main() { log(debug, i); }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:^ cannot be applied to type `str`
1+
// error-pattern:^ cannot be applied to type `str/~`
22

33
fn main() { let x = "a" ^ "b"; }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// error-pattern:expected `str` but found `~[int]`
1+
// error-pattern:expected `str/~` but found `~[int]`
22
fn main() { fail ~[0i]; }

src/test/compile-fail/map-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import std::map::map;
88
fn main() {
99
let x: map<str,str> = map::str_hash::<str>() as map::<str,str>;
1010
let y: map<uint,str> = x;
11-
//~^ ERROR mismatched types: expected `std::map::map<uint,str>`
11+
//~^ ERROR mismatched types: expected `std::map::map<uint,str/~>`
1212
}

src/test/compile-fail/minus-string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
// error-pattern:cannot apply unary operator `-` to type `str`
1+
// error-pattern:cannot apply unary operator `-` to type `str/~`
22

33
fn main() { -"foo"; }

src/test/compile-fail/missing-do.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
fn foo(f: fn()) { f() }
44

55
fn main() {
6-
"" || 42; //~ ERROR binary operation || cannot be applied to type `str`
6+
"" || 42; //~ ERROR binary operation || cannot be applied to type `str/~`
77
foo || {}; //~ ERROR binary operation || cannot be applied to type `extern fn(fn())`
88
//~^ NOTE did you forget the 'do' keyword for the call?
99
}

0 commit comments

Comments
 (0)