@@ -1074,7 +1074,7 @@ Params:
10741074*/
10751075void move (T)(ref T source, ref T target)
10761076{
1077- moveImpl(source, target );
1077+ moveImpl(target, source );
10781078}
10791079
10801080// / For non-struct types, `move` just performs `target = source`:
@@ -1244,7 +1244,7 @@ pure nothrow @safe @nogc unittest
12441244 static assert (is (typeof ({ S s; move(s, s); }) == T));
12451245}
12461246
1247- private void moveImpl (T)(ref T source , ref T target )
1247+ private void moveImpl (T)(ref scope T target , ref return scope T source )
12481248{
12491249 import std.traits : hasElaborateDestructor;
12501250
@@ -1257,10 +1257,10 @@ private void moveImpl(T)(ref T source, ref T target)
12571257 static if (hasElaborateDestructor! T) target.__xdtor();
12581258 }
12591259 // move and emplace source into target
1260- moveEmplaceImpl(source, target );
1260+ moveEmplaceImpl(target, source );
12611261}
12621262
1263- private T moveImpl (T)(ref T source)
1263+ private T moveImpl (T)(ref return scope T source)
12641264{
12651265 // Properly infer safety from moveEmplaceImpl as the implementation below
12661266 // might void-initialize pointers in result and hence needs to be @trusted
@@ -1269,10 +1269,10 @@ private T moveImpl(T)(ref T source)
12691269 return trustedMoveImpl (source);
12701270}
12711271
1272- private T trustedMoveImpl (T)(ref T source) @trusted
1272+ private T trustedMoveImpl (T)(ref return scope T source) @trusted
12731273{
12741274 T result = void ;
1275- moveEmplaceImpl(source, result );
1275+ moveEmplaceImpl(result, source );
12761276 return result;
12771277}
12781278
@@ -1415,7 +1415,7 @@ private T trustedMoveImpl(T)(ref T source) @trusted
14151415 move(x, x);
14161416}
14171417
1418- private void moveEmplaceImpl (T)(ref T source , ref T target )
1418+ private void moveEmplaceImpl (T)(ref scope T target , ref return scope T source )
14191419{
14201420 import core.stdc.string : memcpy, memset;
14211421 import std.traits : hasAliasing, hasElaborateAssign,
@@ -1486,7 +1486,7 @@ private void moveEmplaceImpl(T)(ref T source, ref T target)
14861486 */
14871487void moveEmplace (T)(ref T source, ref T target) pure @system
14881488{
1489- moveEmplaceImpl(source, target );
1489+ moveEmplaceImpl(target, source );
14901490}
14911491
14921492// /
@@ -2388,7 +2388,7 @@ Range remove(alias pred, SwapStrategy s = SwapStrategy.stable, Range)(Range rang
23882388@nogc @safe unittest
23892389{
23902390 // @nogc test
2391- int [10 ] arr = [0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ];
2391+ static int [] arr = [0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ];
23922392 alias pred = e => e < 5 ;
23932393
23942394 auto r = arr[].remove! (SwapStrategy.unstable)(0 );
0 commit comments