Stream: t-compiler/wg-nll

Topic: #52663 missing lifetime suggestion


davidtwco (Oct 05 2018 at 15:26, on Zulip):

@nikomatsakis or @pnkfelix: I'm looking at this comment, the first linked test was tackled by a PR of mine a while ago. The second linked test is missing an error - is that correct or should I look into it? (current AST/current NLL)

nikomatsakis (Oct 05 2018 at 15:31, on Zulip):

@davidtwco hmm

nikomatsakis (Oct 05 2018 at 15:31, on Zulip):

it's not obvious why the AST checker gets an error there to me

nikomatsakis (Oct 05 2018 at 15:31, on Zulip):

looking a bit more

nikomatsakis (Oct 05 2018 at 15:32, on Zulip):

oh, I .. guess I maybe see

nikomatsakis (Oct 05 2018 at 15:32, on Zulip):

curious

nikomatsakis (Oct 05 2018 at 15:33, on Zulip):

looks kind of like a bug to me

davidtwco (Oct 05 2018 at 15:35, on Zulip):

In NLL? We should be producing that error?

nikomatsakis (Oct 05 2018 at 15:36, on Zulip):

right, in NLL

nikomatsakis (Oct 05 2018 at 15:36, on Zulip):

feels like when we invoke iter, we have to infer the lifetime of the trait to be 'r

nikomatsakis (Oct 05 2018 at 15:37, on Zulip):

I think we should file a NLL-sound bug on this

nikomatsakis (Oct 05 2018 at 15:37, on Zulip):

and assign it to you, @davidtwco :)

nikomatsakis (Oct 05 2018 at 15:37, on Zulip):

no good deed and all that

davidtwco (Oct 05 2018 at 15:38, on Zulip):

https://play.rust-lang.org/?gist=bc0b3923ca1be86c74365f2e8874f3e8&version=nightly&mode=debug&edition=2015

nikomatsakis (Oct 05 2018 at 15:38, on Zulip):

(I would be happy to help investigate; I think the first thing is we should check out the region constraints that get generaed)

davidtwco (Oct 05 2018 at 15:38, on Zulip):

Unless I've made a mistake, I think the error does come up after the type mismatch is fixed.

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

ah, that..is plausible

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

we really should work on making rustc less "phase-y"

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

but anyway

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

probably the type mismatch can be removed

davidtwco (Oct 05 2018 at 15:39, on Zulip):

So there isn't an issue here, other than the test being strange?

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

I don't think it's imp't to the test per se?

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

yeah, I guess not

davidtwco (Oct 05 2018 at 15:39, on Zulip):

I can't see why it would be.

nikomatsakis (Oct 05 2018 at 15:39, on Zulip):

I guess I don't know what that is testing

davidtwco (Oct 05 2018 at 15:39, on Zulip):

#13058

davidtwco (Oct 05 2018 at 15:40, on Zulip):

(easier than browsing for that)

nikomatsakis (Oct 05 2018 at 15:40, on Zulip):

For the input file below, the invocation of rustc that prompts with the "consider using an explicit lifetime parameter" hint is providing an erroneous signature.

nikomatsakis (Oct 05 2018 at 15:40, on Zulip):

ok, seems like fixing the type mismatch error is "truer" to the intention of the test

davidtwco (Oct 05 2018 at 15:40, on Zulip):

I'll submit a small PR for that.

davidtwco (Oct 05 2018 at 16:40, on Zulip):

Submitted #54853.

Last update: Nov 22 2019 at 01:00UTC