Stream: t-compiler

Topic: duplication between move & copy


oli (Jun 12 2019 at 07:02, on Zulip):

Apropos Operand::Copy and Operand::Movedo you think it would be error-prone to have Operand::Move and Operand::Copy be one Operand::Consume again and adding a second field for differentiating?

eddyb (Jun 12 2019 at 07:02, on Zulip):

likely yeah

oli (Jun 12 2019 at 07:03, on Zulip):

so, how do you like an Operand::consume method returning an Option<Place>?

eddyb (Jun 12 2019 at 07:03, on Zulip):

nope

oli (Jun 12 2019 at 07:03, on Zulip):

for all the code that matches on Operand::Move and Operand::Copy

eddyb (Jun 12 2019 at 07:03, on Zulip):

anything that doesn't care is likely visiting through operands anyway

oli (Jun 12 2019 at 07:03, on Zulip):

there's loads of duplication

oli (Jun 12 2019 at 07:04, on Zulip):

well... unfortunately the "likely" is not true. We have quite a few of such matches

eddyb (Jun 12 2019 at 07:04, on Zulip):

I guess it depends on the kind of code. but I would expect at least some of them to start treating copies and moves differently

oli (Jun 12 2019 at 07:05, on Zulip):

just grep for Operand::Copy in https://github.com/rust-lang/rust/pull/60913/files

eddyb (Jun 12 2019 at 07:06, on Zulip):

sigh why am I not pinged on that PR?

oli (Jun 12 2019 at 07:14, on Zulip):

because it's nowhere ready

oli (Jun 12 2019 at 07:14, on Zulip):

we're using it as a canary for smaller PRs

eddyb (Jun 12 2019 at 07:14, on Zulip):

yeah but I'd like to know when each of those PRs goes up :P

eddyb (Jun 12 2019 at 07:15, on Zulip):

to hype myself up about them if nothing else!

oli (Jun 12 2019 at 07:16, on Zulip):

kk

Last update: Nov 16 2019 at 01:10UTC