File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
branches/dist-snap/src/rustc/middle Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: a1ab0cd6a836a762632ebb67027d5fd9f349681d
10
+ refs/heads/dist-snap: 53906bb4fb9b2a99878fc6a5cc5cc174ffdea25c
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -1093,12 +1093,15 @@ pure fn mach_sty(cfg: @session::config, t: t) -> sty {
1093
1093
}
1094
1094
1095
1095
fn default_arg_mode_for_ty ( tcx : ctxt , ty : ty:: t ) -> ast:: rmode {
1096
- return if type_is_fn ( ty) {
1097
- // ^^^^^^^^^^^^^^
1098
- // FIXME(#2202) --- We retain by-ref by default to workaround a memory
1099
- // leak that otherwise results when @fn is upcast to &fn.
1100
- ast:: by_ref
1101
- } else if tcx. legacy_modes {
1096
+ // FIXME(#2202) --- We retain by-ref for fn& things to workaround a
1097
+ // memory leak that otherwise results when @fn is upcast to &fn.
1098
+ if type_is_fn ( ty) {
1099
+ match ty_fn_proto ( ty) {
1100
+ proto_vstore( vstore_slice( _) ) => return ast:: by_ref,
1101
+ _ => ( )
1102
+ }
1103
+ }
1104
+ return if tcx. legacy_modes {
1102
1105
if type_is_borrowed ( ty) {
1103
1106
// the old mode default was ++ for things like &ptr, but to be
1104
1107
// forward-compatible with non-legacy, we should use +
You can’t perform that action at this time.
0 commit comments