File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
src/librustc/middle/typeck/check Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2147,11 +2147,11 @@ fn try_overloaded_call<'a>(fcx: &FnCtxt,
2147
2147
_ => { }
2148
2148
}
2149
2149
2150
- // Try `FnOnce`, then `FnMut`, then `Fn` .
2150
+ // Try the options that are least restrictive on the caller first .
2151
2151
for & ( maybe_function_trait, method_name) in [
2152
- ( fcx. tcx( ) . lang_items. fn_once_trait ( ) , token:: intern( "call_once " ) ) ,
2152
+ ( fcx. tcx( ) . lang_items. fn_trait ( ) , token:: intern( "call " ) ) ,
2153
2153
( fcx. tcx( ) . lang_items. fn_mut_trait( ) , token:: intern( "call_mut" ) ) ,
2154
- ( fcx. tcx( ) . lang_items. fn_trait ( ) , token:: intern( "call " ) )
2154
+ ( fcx. tcx( ) . lang_items. fn_once_trait ( ) , token:: intern( "call_once " ) ) ,
2155
2155
] . iter( ) {
2156
2156
let function_trait = match maybe_function_trait {
2157
2157
None => continue ,
You can’t perform that action at this time.
0 commit comments