Skip to content

Commit aaaca6b

Browse files
committed
---
yaml --- r: 14066 b: refs/heads/try c: 966504c h: refs/heads/master v: v3
1 parent 998d61a commit aaaca6b

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: daf0d63a59e5abfb32477748e8df4bffe1fbe2e1
5+
refs/heads/try: 966504c828ded5b6a0a9d4ff5264fb778570005e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/middle/ty.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export type_structurally_contains;
167167
export type_structurally_contains_uniques;
168168
export type_autoderef;
169169
export type_param;
170+
export canon_mode;
170171
export resolved_mode;
171172
export arg_mode;
172173
export unify_mode;

branches/try/src/comp/util/ppaux.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@ import middle::ast_map;
1212
fn ty_to_str(cx: ctxt, typ: t) -> str {
1313
fn fn_input_to_str(cx: ctxt, input: {mode: ast::mode, ty: t}) ->
1414
str {
15-
let arg_mode = ty::arg_mode(cx, input);
16-
let modestr = {
17-
if arg_mode == ty::default_arg_mode_for_ty(cx, input.ty) { "" }
18-
else { mode_to_str(input.mode) }
15+
let {mode, ty} = input;
16+
let modestr = alt canon_mode(cx, mode) {
17+
ast::infer(_) { "" }
18+
ast::expl(m) {
19+
if !ty::type_contains_vars(cx, ty) &&
20+
m == ty::default_arg_mode_for_ty(cx, ty) {
21+
""
22+
} else {
23+
mode_to_str(ast::expl(m))
24+
}
25+
}
1926
};
20-
modestr + ty_to_str(cx, input.ty)
27+
modestr + ty_to_str(cx, ty)
2128
}
2229
fn fn_to_str(cx: ctxt, proto: ast::proto, ident: option<ast::ident>,
2330
inputs: [arg], output: t, cf: ast::ret_style,

0 commit comments

Comments
 (0)