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

Topic: two phase borrows


Matthew Jasper (Nov 24 2018 at 22:43, on Zulip):

@RalfJ https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ca90a070470c1557fa2bffa5017e8ff1

RalfJ (Nov 25 2018 at 09:05, on Zulip):

@Matthew Jasper thanks! miri chokes on it ;)

Matthew Jasper (Nov 25 2018 at 11:17, on Zulip):

Also: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=e6171b97de9eb7e3fab2e8c73757da1f

RalfJ (Nov 25 2018 at 17:33, on Zulip):

thanks!

Matthew Jasper (Nov 26 2018 at 12:40, on Zulip):

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2015&gist=91ad3ea6ef3c07e8b0b3a8c6301af600
https://gist.github.com/91ad3ea6ef3c07e8b0b3a8c6301af600

Matthew Jasper (Nov 26 2018 at 12:46, on Zulip):

and without IM:

use std::ops::AddAssign;
let mut x = 1;
let l = &x;
x                   // (1)
    .add_assign(
        x  // (2)
        +
        *l // (4)
)                   // (3)
;
Matthew Jasper (Nov 26 2018 at 12:46, on Zulip):

related issue: https://github.com/rust-lang/rust/issues/53198

Last update: Nov 19 2019 at 18:45UTC