Skip to content

Commit

Permalink
add @trusted for scope pointer to scope pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright authored and dlang-bot committed May 30, 2021
1 parent 5f7816a commit 74a40f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion std/process.d
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@ Pid spawnShell(scope const(char)[] command,
Config config = Config.none,
scope const(char)[] workDir = null,
scope string shellPath = nativeShell)
@safe
@trusted // See reason below
{
version (Windows)
{
Expand All @@ -1957,6 +1957,11 @@ Pid spawnShell(scope const(char)[] command,
args[0] = shellPath;
args[1] = shellSwitch;
args[2] = command;
/* The passing of args converts the static array, which is initialized with `scope` pointers,
* to a dynamic array, which is also a scope parameter. So, it is a scope pointer to a
* scope pointer, which although is safely used here, D doesn't allow transitive scope.
* See https://github.com/dlang/dmd/pull/10951
*/
return spawnProcessPosix(args, stdin, stdout, stderr, env, config, workDir);
}
else
Expand Down

0 comments on commit 74a40f4

Please sign in to comment.