aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle/ty.rs
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2011-04-06 10:25:32 -0700
committerPatrick Walton <[email protected]>2011-04-06 10:25:32 -0700
commitd9da43984b5e9d50f711320d2afc3307537dfb44 (patch)
tree6b9b3eefc8909c7621c01b7e039375deb019e7b1 /src/comp/middle/ty.rs
parentrustc: Make type_of() return the type of the wrapper for native functions. li... (diff)
parentMinimal testcase for next bootstrap blocker. (diff)
downloadrust-d9da43984b5e9d50f711320d2afc3307537dfb44.tar.xz
rust-d9da43984b5e9d50f711320d2afc3307537dfb44.zip
Merge branch 'master' of github.com:graydon/rust
Diffstat (limited to 'src/comp/middle/ty.rs')
-rw-r--r--src/comp/middle/ty.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs
index d0b5fe10..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);
@@ -564,8 +570,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 {