File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: daf0d63a59e5abfb32477748e8df4bffe1fbe2e1
5
+ refs/heads/try: 966504c828ded5b6a0a9d4ff5264fb778570005e
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -167,6 +167,7 @@ export type_structurally_contains;
167
167
export type_structurally_contains_uniques;
168
168
export type_autoderef;
169
169
export type_param;
170
+ export canon_mode;
170
171
export resolved_mode;
171
172
export arg_mode;
172
173
export unify_mode;
Original file line number Diff line number Diff line change @@ -12,12 +12,19 @@ import middle::ast_map;
12
12
fn ty_to_str ( cx : ctxt , typ : t ) -> str {
13
13
fn fn_input_to_str ( cx : ctxt , input : { mode : ast:: mode , ty : t } ) ->
14
14
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
+ }
19
26
} ;
20
- modestr + ty_to_str ( cx, input . ty )
27
+ modestr + ty_to_str ( cx, ty)
21
28
}
22
29
fn fn_to_str ( cx : ctxt , proto : ast:: proto , ident : option < ast:: ident > ,
23
30
inputs : [ arg ] , output : t , cf : ast:: ret_style ,
You can’t perform that action at this time.
0 commit comments