Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spurious additional lifetime appearing in printout of type involving HRT lifetimes #102392

Closed
steffahn opened this issue Sep 28, 2022 · 4 comments · Fixed by #102514
Closed

Spurious additional lifetime appearing in printout of type involving HRT lifetimes #102392

steffahn opened this issue Sep 28, 2022 · 4 comments · Fixed by #102514
Labels
A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@steffahn
Copy link
Member

steffahn commented Sep 28, 2022

“Related” to #102346, and #101280, as this, too, is about diagnostic printing of types with HRT lifetimes (unlike the former related issue, this issue is not a recent regression):

fn g(f: for<'a> fn(fn(&str, &'a str))) -> bool {
    f
}
error[E0308]: mismatched types
 --> src/lib.rs:2:5
  |
1 | fn g(f: for<'a> fn(fn(&str, &'a str))) -> bool {
  |                                           ---- expected `bool` because of return type
2 |     f
  |     ^ expected `bool`, found fn pointer
  |
  = note:    expected type `bool`
          found fn pointer `for<'a> fn(for<'b, 'a> fn(&'b str, &'a str))`

The way this type is displayed includes an additional superflous/confusing/wrong quantification of 'a in the inner for. Correct would be for<'a> fn(for<'b> fn(&'b str, &'a str)), not for<'a> fn(for<'b, 'a> fn(&'b str, &'a str)).

cc @b-naber who is currently working on the above-mentioned “related” issues.

@rustbot label regression-from-stable-to-stable, E-needs-bisection

Regresses between 1.54 and 1.55:

1.54

  = note:    expected type `bool`
          found fn pointer `for<'a> fn(for<'r> fn(&'r str, &'a str))`

1.55

  = note:    expected type `bool`
          found fn pointer `for<'a> fn(for<'r, 'a> fn(&'r str, &'a str))`
@steffahn steffahn added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 28, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 28, 2022

Error: Label needs-bisection can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@rustbot rustbot added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc regression-from-stable-to-stable Performance or correctness regression from one stable version to another. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 28, 2022
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-low

@rustbot rustbot added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Sep 28, 2022
@apiraino
Copy link
Contributor

apiraino commented Sep 28, 2022

Bisection seems to indicate this group of PRs in the range --start 2021-07-01 --end 2021-12-01.

********************************************************************************
Regression in nightly-2021-07-23
********************************************************************************

  commit[0] 2021-07-21UTC: Auto merge of #87351 - ehuss:rollup-pga85az, r=ehuss
  commit[1] 2021-07-21UTC: Auto merge of #86946 - Aaron1011:eval-proj-obligation, r=nikomatsakis
  commit[2] 2021-07-22UTC: Auto merge of #87246 - rust-lang:placeholder-pretty, r=nikomatsakis
  commit[3] 2021-07-22UTC: Auto merge of #87250 - robojumper:87199-sized-relaxation, r=nikomatsakis
  commit[4] 2021-07-22UTC: Auto merge of #87265 - Aaron1011:hir-wf-fn, r=estebank
  commit[5] 2021-07-22UTC: Auto merge of #86619 - rylev:incr-hashing-profiling, r=wesleywiser
  commit[6] 2021-07-22UTC: Auto merge of #87366 - GuillaumeGomez:rollup-7muueab, r=GuillaumeGomez
  commit[7] 2021-07-22UTC: Auto merge of #87371 - ehuss:update-cargo, r=ehuss
  commit[8] 2021-07-22UTC: Auto merge of #86212 - pnkfelix:mainline-targetted-revert-81473-warn-write-only-fields, r=simulacrum

but due to the age I could not pinpoint a specific nightly.

Also, as pointed out in the previous comment at some point the diagnostic changed and decided to use another wording (for<'a> fn(for<'b, 'a> fn(&'b str, &'a str))) which I wonder if it's related to one of the mentioned other 2 issues

@rustbot label -E-needs-bisection

@rustbot rustbot removed the E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc label Sep 28, 2022
@steffahn
Copy link
Member Author

Looking through this list, #87246 seems likely.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 8, 2022
…h726

Don't repeat lifetime names from outer binder in print

Fixes rust-lang#102392
Fixes rust-lang#102414

r? `@lcnr`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 8, 2022
…h726

Don't repeat lifetime names from outer binder in print

Fixes rust-lang#102392
Fixes rust-lang#102414

r? ``@lcnr``
@bors bors closed this as completed in 5ba30a6 Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints P-low Low priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants