Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make std.socket DIP1000 compatible #6384

Merged
merged 1 commit into from
Apr 3, 2018
Merged

Conversation

wilzbach
Copy link
Member

From @WalterBright:

How about simply making std.socket @System so it will compile with -dip1000 and move on?

#6204 (comment)

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + phobos#6384"

@wilzbach wilzbach added the Vision Vision Plan https://wiki.dlang.org/Vision/2018H1 label Mar 29, 2018
@wilzbach wilzbach added this to In progress in DIP1000 via automation Mar 29, 2018
std/socket.d Outdated
@@ -2477,13 +2477,19 @@ public:
assert(!errorSet.isSet(testPair[1]));

ubyte[1] b;
testPair[0].send(b[]);
// std.socket isn't fully @safe anymore - see https://github.com/dlang/phobos/pull/6204
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment seems odd/wrong – std.socket is just as safe as before, it's just that the send/receive arguments aren't marked as scope, so client code isn't safe anymore with dip1000.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Tried to improve the wording.

@dnadlinger
Copy link
Member

Seems like the best compromise – -dip1000 might break some Phobos client code that previously escaped references to stack data this way, but we can't easily work around that.

@n8sh n8sh added the auto-merge label Apr 3, 2018
@dlang-bot dlang-bot merged commit a7006d1 into dlang:master Apr 3, 2018
DIP1000 automation moved this from In progress to Done Apr 3, 2018
@wilzbach wilzbach deleted the pr-6204 branch April 3, 2018 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Vision Vision Plan https://wiki.dlang.org/Vision/2018H1
Projects
No open projects
DIP1000
  
Done
4 participants