Uh oh!
There was an error while loading. Please reload this page.
Update E0088 to new format - #36208
Conversation
rust-highfive
commented
Sep 2, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonathandturner (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
There was a problem hiding this comment.
Now that we handle multiple cases, can you add to the unit test to check for these new cases?
sophiajt
commented
Sep 2, 2016
Thanks for the PR! Looks like we'll need to test for some of your new cases. After that I think we're probably good to go. |
@jonathandturner I'm not much of a rust expert, but does the second case make sense? I can't think of a code to trigger this, perhaps you can point me in some useful direction? |
sophiajt
commented
Sep 4, 2016
You could try an example that tests against two different functions, one with a lifetime and one without. Something like: |
yossi-k
commented
Sep 4, 2016
@jonathandturner That was also my first guess, but |
sophiajt
commented
Sep 4, 2016
@yossi-k - looks like you're right. When I try it with functions, the lifetime parameters seem to be ignored. If I try it with traits, I just get a different error message: It may not be possible to invoke the code path. If that's the case, it may make sense to always say "unexpected lifetime parameters" in the label |
@jonathandturner So considering that it doesn't seem possible to actually provide a lifetime parameter to a function, and providing lifetimes to other things (such as traits) is covered by a whole different set of errors (e.g. E0107), is this code segment actually needed? |
sophiajt
commented
Sep 5, 2016
@yossi-k - you could try taking it out and running the unit test suite again and see what happens. If all of the errors are still caught by E0107, you might be right. And it would help us simplify things. |
yossi-k
commented
Sep 8, 2016
@jonathandturner All tests seem to pass, so I'm guessing we're okay. |
sophiajt
commented
Sep 8, 2016
@yossi-k - unfortunately, you can't safely merge multiple spans together, since spans can come from macros and might give you a broken span as a result. |
yossi-k
commented
Sep 8, 2016
@jonathandturner What should I do in this case? Only reference one lifetime parameter, perhaps each individually or maybe just the entire function call? |
sophiajt
commented
Sep 22, 2016
@yossi-k - I just added a way to safely merge spans to CodeMap. It's a new method called |
sophiajt
commented
Sep 26, 2016
@yossi-k - after working some with @GuillaumeGomez, I think a better solution than merging spans would be to instead point at the argument when it's unexpected. You can see an example on E0050 |
GuillaumeGomez
commented
Sep 27, 2016
@jonathandturner: It hasn't been updated yet. :p |
sophiajt
commented
Sep 27, 2016
@GuillaumeGomez - moved it from a comment to the issue text. Should be updated now |
alexcrichton
commented
Oct 31, 2016
Closing due to inactivity, but feel free to resubmit with a rebase! |
Update E0088 to new error format Fixesrust-lang#35226 which is part of rust-lang#35233. Is based on rust-lang#36208 from @yossi-k. r? @jonathandturner
eddyb
commented
Jan 5, 2017
@jonathandturner You should've asked a rustc developer 😭. This (through #37835) introduced a regression which I only found because I was rewriting lifetime elision and I had to update this check. Thankfully it's only propagated to beta so we can just backport a fix, but this is scary that it just happened. What's confusing here is the distinction between early-bound and late-bound Late-bound lifetimes, explicitly expressed by For some historical reason or another, we ended up mapping lifetimes passed to a path to only the early-bound lifetimes and have no mechanism for "downgrading" late- to early-bound for paths with lifetimes. To wrap it up, this is the test I used (errors on 1.14 stable, incorrectly passes on beta/nightly): fnfoo<'a:'b,'b:'a>(){}fnmain(){foo::<'static>();}cc @rust-lang/compiler @rust-lang/lang |
arielb1
commented
Jan 5, 2017
That's just an implementation artifact, methinks. |
sophiajt
commented
Jan 5, 2017
@eddyb - you're commenting on a closed PR, I assume you meant the merged one? Glad we could catch it in time. Looking at it now, definitely an oversight on my part. Clearly they changed the logic rather than just changing the message. |
sophiajt
commented
Jan 5, 2017
E0088/E0090 fix This fixes an issue reported by @eddyb (#36208 (comment)) where the check for "too few lifetime parameters" was removed in one of the error message PRs. I also removed the span shrinking from E0088, as early bound lifetimes give you a confusing underline in some cases. r=eddyb
E0088/E0090 fix This fixes an issue reported by @eddyb (#36208 (comment)) where the check for "too few lifetime parameters" was removed in one of the error message PRs. I also removed the span shrinking from E0088, as early bound lifetimes give you a confusing underline in some cases. r=eddyb
Fixes#35226.
Part of #35233.
r? @jonathandturner