Skip to content

Commit de16674

Browse files
committed
rustboot: Report the alias-ness of function parameters in type errors
1 parent 79015e2 commit de16674

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/boot/me/semant.ml

+6-1
Original file line numberDiff line numberDiff line change
@@ -999,9 +999,14 @@ let rec pretty_ty_str (cx:ctxt) (fallback:(Ast.ty -> string)) (ty:Ast.ty) =
999999
"rec(" ^ (String.concat ", " fields) ^ ")"
10001000
| Ast.TY_fn (fnsig, aux) ->
10011001
let format_slot slot =
1002+
let prefix =
1003+
match slot.Ast.slot_mode with
1004+
Ast.MODE_local -> ""
1005+
| Ast.MODE_alias -> "&"
1006+
in
10021007
match slot.Ast.slot_ty with
10031008
None -> Common.bug () "no ty in slot"
1004-
| Some ty' -> pretty_ty_str cx fallback ty'
1009+
| Some ty' -> prefix ^ (pretty_ty_str cx fallback ty')
10051010
in
10061011
let effect = aux.Ast.fn_effect in
10071012
let qual = Fmt.sprintf_fmt Ast.fmt_effect_qual () effect in

0 commit comments

Comments
 (0)