File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed 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