I'm having a bit of trouble in https://github.com/rust-lang/rust/pull/58281. It seems that for some async fns, elided lifetimes produce regions that are actually called
'_ now? To the best of my understanding, this is due to the changes in https://github.com/rust-lang/rust/pull/63501
The problem is that now, we don't properly generate a new lifetime for emitting diagnostics, so with my changes, we now have error messages like
help: consider adding the following bound: `'_: '_`
Based on my limited understanding, it seems like sometimes, we should be generating
ParamName::Fresh rather than
ParamName::Plain when we lower
async fns. Any thoughts?
not sure if @Matthew Jasper or @pnkfelix would be able to help too...
I think I made some changes in this regard, actually
In particular, using
ParamName::Fresh to generate elided lifetimes
That said: the problem of "anonymous lifetimes" is one of the reasons the NLL errors were introducing names for lifetimes and things, right? I guess I'd have to read a bit more into the code. But in the meantime, I'd say, try rebasing and see if things are any better? If not, ping me again and we can dig a bit more in :)
@nikomatsakis I rebased, but am still getting the same
the problem of "anonymous lifetimes" is one of the reasons the NLL errors were introducing names for lifetimes and things, right?
yes, that's my understanding, which is why I think somewhere we have a bug that fails to recognize anon lifetimes...
Oh, I was confusing this and https://github.com/rust-lang/rust/pull/63678/
@nikomatsakis Do you have any tips on how to debug the source of the lifetime names? I would rather not read the entire
librustc_mir looking for them :P
@mark-i-m yeah, sorry, let me schedule some time to look into this. i've added an hour tomorrow, though I might bump it up to today. In the meantime I'll get a build going. I'll post you a response after that!
btw, it looks like this only happens in async tests, so perhaps it is related to inferred member lifetimes?
@mark-i-m what's an example test where this occurs?
I guess async-await/issues/issue-63388-1.rs
Sorry I'm not at my computer atm, but the nll compare mode tests on m branch do this
Here is the full list of tests:
$ git status On branch synthesis Your branch is up to date with 'origin/synthesis'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: src/test/ui/async-await/issues/issue-63388-1.nll.stderr modified: src/test/ui/c-variadic/variadic-ffi-4.nll.stderr modified: src/test/ui/self/arbitrary_self_types_pin_lifetime_impl_trait-async.nll.stderr modified: src/test/ui/self/arbitrary_self_types_pin_lifetime_mismatch-async.nll.stderr modified: src/test/ui/self/elision/lt-ref-self-async.nll.stderr modified: src/test/ui/self/elision/ref-mut-self-async.nll.stderr modified: src/test/ui/self/elision/ref-mut-struct-async.nll.stderr modified: src/test/ui/self/elision/ref-self-async.nll.stderr modified: src/test/ui/self/elision/ref-struct-async.nll.stderr
Hi @nikomatsakis do you have any suggestions on how to debug this
I'm particular i want to trace the origins of a region name