From 70e5457d7c99d3b273c3ef9edaebee1324be85c7 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Mon, 4 Apr 2011 15:44:15 -0700 Subject: Make box prefix operator and box type carry mutability flag. --- src/comp/middle/ty.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/comp/middle/ty.rs') diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index d0b5fe10..24bd647f 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -564,8 +564,8 @@ fn plain_ty(&sty st) -> @t { ret @rec(struct=st, cname=none[str]); } -fn plain_box_ty(@t subty) -> @t { - ret plain_ty(ty_box(rec(ty=subty, mut=ast.imm))); +fn plain_box_ty(@t subty, ast.mutability mut) -> @t { + ret plain_ty(ty_box(rec(ty=subty, mut=mut))); } fn plain_tup_ty(vec[@t] elem_tys) -> @t { -- cgit v1.2.3 From 4fc8de196977a0e5bb4f733f7aaeb1162e880eaa Mon Sep 17 00:00:00 2001 From: Lindsey Kuper Date: Tue, 5 Apr 2011 16:17:47 -0700 Subject: Last pieces of self-call support. The last few pieces of the hack that lets us use trans.trans_call() to translate self-calls, plus a fix for the parser buy that was preventing self-call expressions from getting past parsing. test/run-pass/obj-self.rs works now (as in it actually prints "hi!" twice!). --- src/comp/middle/ty.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/comp/middle/ty.rs') diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 24bd647f..f83bece7 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -26,6 +26,12 @@ type method = rec(ast.proto proto, type mt = rec(@t ty, ast.mutability mut); +// Convert from method type to function type. Pretty easy; we just drop +// 'ident'. +fn method_ty_to_fn_ty(method m) -> @ty.t { + ret plain_ty(ty_fn(m.proto, m.inputs, m.output)); +} + // NB: If you change this, you'll probably want to change the corresponding // AST structure in front/ast.rs as well. type t = rec(sty struct, option.t[str] cname); -- cgit v1.2.3