Stream: t-compiler/help

Topic: mir::Body impls Copy?


Paul Faria (Oct 25 2019 at 21:50, on Zulip):

What makes mir::Body impl ArenaAllocatable? I can see that in librustc/query/mod.rs (https://github.com/rust-lang/rust/blob/master/src/librustc/query/mod.rs#L128) that it's passed to fn alloc of https://github.com/rust-lang/rust/blob/master/src/librustc/arena.rs#L201 , but I can only find impl <T: Copy> ArenaAllocatable for T {}, and Body isn't Copy. So where's the plumbing that makes this work???

simulacrum (Oct 25 2019 at 21:51, on Zulip):

@Paul Faria https://github.com/Mark-Simulacrum/rust/blob/1ab8dc8e119fa7f963c0dcee29574e694ed9d08d/src/librustc/arena.rs#L27 is I suspect the answer to your question

Paul Faria (Oct 25 2019 at 22:27, on Zulip):

That's exactly it. Thank you!

Last update: Nov 11 2019 at 22:05UTC