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

Topic: stacked borrows: retag on drop shims


gnzlbg (Feb 21 2019 at 11:26, on Zulip):

@RalfJ

The automatically generated drop shims perform a Raw retag of their argument because they use it as a raw pointer.

Does this also applies for Drop::drop(&mut self) ? Or why does this behave differently ?

RalfJ (Feb 21 2019 at 11:59, on Zulip):

Drop::drop is not the automatically generated drop shim

RalfJ (Feb 21 2019 at 11:59, on Zulip):

that would be ptr::real_drop_in_place nowadays

gnzlbg (Feb 21 2019 at 12:03, on Zulip):

Is the automatically generated drop shim called at the end / after Drop::drop for Drop types? I don't know how this works.

RalfJ (Feb 21 2019 at 12:06, on Zulip):

the drop shim calls Drop::drop

gnzlbg (Feb 21 2019 at 12:06, on Zulip):

Ah ok!

RalfJ (Feb 21 2019 at 12:06, on Zulip):

and then proceeds to recursively call the drop shim for the fields

Last update: Nov 20 2019 at 13:35UTC