Stream: t-compiler/wg-nll

Topic: #54985 strange `*` suggestion


davidtwco (Oct 11 2018 at 09:29, on Zulip):

I'm happy to try improve this suggestion - does anyone have any thoughts on what we want to do here?

Is this suggestion valid in some circumstances and we could improve the logic with which we deploy the suggestion? Is it always wrong? There are a bunch of places where this suggestion is produced.

pnkfelix (Oct 11 2018 at 09:31, on Zulip):

I can imagine plenty of places where its valid to say "you don't need to deref here"

pnkfelix (Oct 11 2018 at 09:31, on Zulip):

e.g. (*foo).method() when method is fn method(&self)

nikomatsakis (Oct 11 2018 at 09:51, on Zulip):

What are the circumstances in which we produce that suggestion, exactly?

nikomatsakis (Oct 11 2018 at 09:52, on Zulip):

I feel like we should just make no suggestion there

nikomatsakis (Oct 11 2018 at 09:52, on Zulip):

basically, they wrote *x, if they change to x, that could be right, but now they have a borrowed thing, so it's quite different from what they had...

davidtwco (Oct 11 2018 at 09:53, on Zulip):

It looks like this code produces that.

nikomatsakis (Oct 11 2018 at 09:53, on Zulip):

...e.g., maybe they want to change the function to not borrow?

nikomatsakis (Oct 11 2018 at 09:54, on Zulip):

I don't know, maybe it's fine. I have to run now anyhow...

Last update: Nov 21 2019 at 14:50UTC