mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
parent
be1feaa918
commit
865dcb663d
@ -285,6 +285,9 @@ fn ast_ty_to_ty(tcx: ty::ctxt, getter: ty_getter, ast_ty: @ast::ty) -> ty::t {
|
||||
ast::ty_box(mt) {
|
||||
typ = ty::mk_box(tcx, ast_mt_to_mt(tcx, getter, mt));
|
||||
}
|
||||
ast::ty_uniq(mt) {
|
||||
typ = ty::mk_uniq(tcx, ast_ty_to_ty(tcx, getter, mt.ty));
|
||||
}
|
||||
ast::ty_vec(mt) {
|
||||
typ = ty::mk_vec(tcx, ast_mt_to_mt(tcx, getter, mt));
|
||||
}
|
||||
|
@ -307,6 +307,7 @@ tag ty_ {
|
||||
ty_char;
|
||||
ty_str;
|
||||
ty_box(mt);
|
||||
ty_uniq(mt);
|
||||
ty_vec(mt);
|
||||
ty_ptr(mt);
|
||||
ty_task;
|
||||
|
@ -540,6 +540,11 @@ fn parse_ty(p: parser, colons_before_params: bool) -> @ast::ty {
|
||||
let mt = parse_mt(p);
|
||||
hi = mt.ty.span.hi;
|
||||
t = ast::ty_box(mt);
|
||||
} else if p.peek() == token::TILDE {
|
||||
p.bump();
|
||||
let mt = parse_mt(p);
|
||||
hi = mt.ty.span.hi;
|
||||
t = ast::ty_uniq(mt);
|
||||
} else if p.peek() == token::BINOP(token::STAR) {
|
||||
p.bump();
|
||||
let mt = parse_mt(p);
|
||||
|
@ -260,6 +260,7 @@ fn print_type(s: ps, ty: @ast::ty) {
|
||||
ast::ty_char. { word(s.s, "char"); }
|
||||
ast::ty_str. { word(s.s, "str"); }
|
||||
ast::ty_box(mt) { word(s.s, "@"); print_mt(s, mt); }
|
||||
ast::ty_uniq(mt) { word(s.s, "~"); print_mt(s, mt); }
|
||||
ast::ty_vec(mt) {
|
||||
word(s.s, "[");
|
||||
alt mt.mut {
|
||||
|
@ -121,6 +121,7 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
|
||||
ty_char. {/* no-op */ }
|
||||
ty_str. {/* no-op */ }
|
||||
ty_box(mt) { v.visit_ty(mt.ty, e, v); }
|
||||
ty_uniq(mt) { v.visit_ty(mt.ty, e, v); }
|
||||
ty_vec(mt) { v.visit_ty(mt.ty, e, v); }
|
||||
ty_ptr(mt) { v.visit_ty(mt.ty, e, v); }
|
||||
ty_port(t) { v.visit_ty(t, e, v); }
|
||||
|
7
src/test/run-pass/unique-decl.rs
Normal file
7
src/test/run-pass/unique-decl.rs
Normal file
@ -0,0 +1,7 @@
|
||||
fn main() {
|
||||
let _: ~int;
|
||||
}
|
||||
|
||||
fn f(i: ~int) -> ~int {
|
||||
fail;
|
||||
}
|
Loading…
Reference in New Issue
Block a user