aboutsummaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-11-05 18:27:15 -0700
committerPatrick Walton <[email protected]>2010-11-05 18:27:34 -0700
commitde166745b8035395485bc5bc598f9c507ae80376 (patch)
tree3c602c234e9eac5f09b58dd5ac31fac35c9cca63 /src/boot
parentrustboot: If something that wasn't a type was found where a type was expected... (diff)
downloadrust-de166745b8035395485bc5bc598f9c507ae80376.tar.xz
rust-de166745b8035395485bc5bc598f9c507ae80376.zip
rustboot: Report the alias-ness of function parameters in type errors
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/me/semant.ml7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/boot/me/semant.ml b/src/boot/me/semant.ml
index 9a5cee15..c22e788b 100644
--- a/src/boot/me/semant.ml
+++ b/src/boot/me/semant.ml
@@ -999,9 +999,14 @@ let rec pretty_ty_str (cx:ctxt) (fallback:(Ast.ty -> string)) (ty:Ast.ty) =
"rec(" ^ (String.concat ", " fields) ^ ")"
| Ast.TY_fn (fnsig, aux) ->
let format_slot slot =
+ let prefix =
+ match slot.Ast.slot_mode with
+ Ast.MODE_local -> ""
+ | Ast.MODE_alias -> "&"
+ in
match slot.Ast.slot_ty with
None -> Common.bug () "no ty in slot"
- | Some ty' -> pretty_ty_str cx fallback ty'
+ | Some ty' -> prefix ^ (pretty_ty_str cx fallback ty')
in
let effect = aux.Ast.fn_effect in
let qual = Fmt.sprintf_fmt Ast.fmt_effect_qual () effect in