Munksgaard / session-types

MIT License
550 stars 21 forks source link

Improve unsafe code #58

Closed Manishearth closed 5 years ago

Manishearth commented 5 years ago

We used channels on Box<u8> when we should have used channels on *const u8, otherwise channel destructors attempt to clean up this allocation of a Box<u8> and fail.

Fixes #56

Currently requires nightly-only functionality

Munksgaard commented 5 years ago

The test that I wrote should probably be converted into a run-fail test or something like that. At the same time we should add the inverse test where the client prematurely drops the channel.

Manishearth commented 5 years ago

@Munksgaard should_panic tests exist, I annotated your test with those. There's no run-fail test in libtest by default.

Munksgaard commented 5 years ago

Perfect, thanks :+1:

Munksgaard commented 5 years ago

But this is great, great work. What is needed in order to get it to run on stable? We'd just managed to get everything working so it would be a shame to lose stable support again.

Manishearth commented 5 years ago

It's stable already, I realized that ManuallyDrop exists and it's what we wanted anyway.

Manishearth commented 5 years ago

May want to do a release

Munksgaard commented 5 years ago

Will do.