Skip to content

Try to use approximate placeholder regions when outputting an AscribeUserType error in borrowck #116097

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

Merged
merged 1 commit into from
Nov 16, 2023

Conversation

jackh726
Copy link
Member

Fixes #114866

Hi from GOSIM :)

@rustbot
Copy link
Collaborator

rustbot commented Sep 23, 2023

r? @wesleywiser

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 23, 2023
@jackh726 jackh726 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 23, 2023
Comment on lines +7 to +8
= note: expected reference `&String`
found reference `&String`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I consider this an improvement over "higher ranked lifetime error".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the note is not all that helpful. But its actually very similar to our pre-NLL error (see output on 1.64).

I consider this more of a "get us back to where we were" than a "this is the best we can do"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "one type is more general than the other" note is the most helpful part of the diagnostic, and I think that's an improvement over "higher-ranked lifetime error" alone.

Comment on lines 40 to 41
= note: expected trait `Send`
found trait `for<'a> Send`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we end up reporting this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure :) seems like something with our lowering isn't quite right. I've seen something similar before, I think.

@jackh726 jackh726 force-pushed the higher-ranked-lifetime-error-backup branch from 4be5645 to 35dd0c9 Compare September 24, 2023 06:11
@jackh726
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 24, 2023
@wesleywiser
Copy link
Member

r? @compiler-errors

Would you mind taking another look at this? I'm not sure if your initial feedback has all been resolved as you expect or not.

@compiler-errors
Copy link
Member

@bors r+

I still don't think I agree that this PR is better but whatever

@bors
Copy link
Collaborator

bors commented Nov 16, 2023

📌 Commit 35dd0c9 has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 16, 2023
@bors
Copy link
Collaborator

bors commented Nov 16, 2023

⌛ Testing commit 35dd0c9 with merge 820f06b...

@bors
Copy link
Collaborator

bors commented Nov 16, 2023

☀️ Test successful - checks-actions
Approved by: compiler-errors
Pushing 820f06b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 16, 2023
@bors bors merged commit 820f06b into rust-lang:master Nov 16, 2023
@rustbot rustbot added this to the 1.76.0 milestone Nov 16, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (820f06b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
-0.7% [-0.9%, -0.4%] 5
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) -0.5% [-0.9%, 0.5%] 6

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 674.025s -> 675.791s (0.26%)
Artifact size: 313.64 MiB -> 313.65 MiB (0.00%)

@jackh726 jackh726 deleted the higher-ranked-lifetime-error-backup branch November 17, 2023 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

higher-ranked lifetime error
6 participants