Make str be treated as str/~.
This commit is contained in:
parent
b569bdec9f
commit
7b26503566
|
@ -652,7 +652,7 @@ fn mk_mach_float(cx: ctxt, tm: ast::float_ty) -> t { mk_t(cx, ty_float(tm)) }
|
|||
|
||||
fn mk_char(cx: ctxt) -> t { mk_t(cx, ty_int(ast::ty_char)) }
|
||||
|
||||
fn mk_str(cx: ctxt) -> t { mk_t(cx, ty_str) }
|
||||
fn mk_str(cx: ctxt) -> t { mk_estr(cx, vstore_uniq) }
|
||||
|
||||
fn mk_estr(cx: ctxt, t: vstore) -> t {
|
||||
mk_t(cx, ty_estr(t))
|
||||
|
|
|
@ -223,7 +223,7 @@ fn arg_is_argv_ty(_tcx: ty::ctxt, a: ty::arg) -> bool {
|
|||
ty::ty_evec(mt, vstore_uniq) {
|
||||
if mt.mutbl != ast::m_imm { ret false; }
|
||||
alt ty::get(mt.ty).struct {
|
||||
ty::ty_str { ret true; }
|
||||
ty::ty_estr(vstore_uniq) { ret true; }
|
||||
_ { ret false; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// error-pattern:expected `str` but found `int`
|
||||
// error-pattern:expected `str/~` but found `int`
|
||||
|
||||
const i: str = 10i;
|
||||
fn main() { log(debug, i); }
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
// error-pattern:^ cannot be applied to type `str`
|
||||
// error-pattern:^ cannot be applied to type `str/~`
|
||||
|
||||
fn main() { let x = "a" ^ "b"; }
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
// error-pattern:expected `str` but found `~[int]`
|
||||
// error-pattern:expected `str/~` but found `~[int]`
|
||||
fn main() { fail ~[0i]; }
|
||||
|
|
|
@ -8,5 +8,5 @@ import std::map::map;
|
|||
fn main() {
|
||||
let x: map<str,str> = map::str_hash::<str>() as map::<str,str>;
|
||||
let y: map<uint,str> = x;
|
||||
//~^ ERROR mismatched types: expected `std::map::map<uint,str>`
|
||||
//~^ ERROR mismatched types: expected `std::map::map<uint,str/~>`
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
// error-pattern:cannot apply unary operator `-` to type `str`
|
||||
// error-pattern:cannot apply unary operator `-` to type `str/~`
|
||||
|
||||
fn main() { -"foo"; }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
fn foo(f: fn()) { f() }
|
||||
|
||||
fn main() {
|
||||
"" || 42; //~ ERROR binary operation || cannot be applied to type `str`
|
||||
"" || 42; //~ ERROR binary operation || cannot be applied to type `str/~`
|
||||
foo || {}; //~ ERROR binary operation || cannot be applied to type `extern fn(fn())`
|
||||
//~^ NOTE did you forget the 'do' keyword for the call?
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue