Stream: t-lang/wg-unsafe-code-guidelines

Topic: coercions considered harmful: async fn and Stacked Borrows


RalfJ (Nov 28 2018 at 18:25, on Zulip):

See https://github.com/solson/miri/issues/532#issuecomment-442552764: If my analysis is correct, async fn violates Stacked Borrows, but that's just a silly mistake that went unnoticed only because mutable references implicitly coerce to shared references.

Ariel Ben-Yehuda (Nov 28 2018 at 23:07, on Zulip):

a.k.a. why my ACA model did not treat mutable references as "asserting" (i.e. popping the stack) until they are used to some degree.

Ariel Ben-Yehuda (Nov 28 2018 at 23:09, on Zulip):

of course, that approach has the disadvantage of forcing a tree instead of a stack.

Ariel Ben-Yehuda (Nov 28 2018 at 23:12, on Zulip):

it's somewhat weird to see that the examples that violate this are clearly mistakes, rather than being just dubious unsafe code.

Ariel Ben-Yehuda (Nov 28 2018 at 23:12, on Zulip):

(I expected it to be mainly dubious unsafe code that just uses &mut as intermediates).

Last update: Nov 19 2019 at 18:20UTC