Skip to content

Pretty-print argument-position impl trait to name it. #113955

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 2 commits into from
Sep 19, 2023

Conversation

cjgillot
Copy link
Contributor

This removes a corner case.

RPIT and TAIT keep having no name, and it would be wrong to use the one in HIR (Ident::empty), so I make this case ICE.

@rustbot
Copy link
Collaborator

rustbot commented Jul 22, 2023

r? @WaffleLapkin

(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 Jul 22, 2023
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot marked this pull request as draft July 22, 2023 10:44
@cjgillot cjgillot marked this pull request as ready for review July 22, 2023 13:17
@WaffleLapkin
Copy link
Member

I don't understand the reasons behind this change/the difference of RPIT/APIT in the case/implications, could you explain more? @cjgillot

@WaffleLapkin
Copy link
Member

@rustbot author

@rustbot rustbot 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 Jul 30, 2023
@cjgillot
Copy link
Contributor Author

cjgillot commented Aug 4, 2023

impl-trait are currently given an anonymous def-path ImplTrait, which prints opaque with a number.

This is fine for stuff that are truly anonymous, like an RPIT or the opaques inside a TAIT. Those have an empty name in HIR.

APIT do have a name: themselves pretty-printed. So there is no real reason not to give them that name in their def-path, to be the user-facing impl MyTrait. This makes APIT behave exactly like a generic parameter named impl MyTrait, in the type namespace.

@cjgillot cjgillot 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 Aug 4, 2023
@WaffleLapkin
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 19, 2023

📌 Commit 832a2a1 has been approved by WaffleLapkin

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 Sep 19, 2023
@bors
Copy link
Collaborator

bors commented Sep 19, 2023

⌛ Testing commit 832a2a1 with merge bdb0fa3...

@bors
Copy link
Collaborator

bors commented Sep 19, 2023

☀️ Test successful - checks-actions
Approved by: WaffleLapkin
Pushing bdb0fa3 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 19, 2023
@bors bors merged commit bdb0fa3 into rust-lang:master Sep 19, 2023
@rustbot rustbot added this to the 1.74.0 milestone Sep 19, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bdb0fa3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 2
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 3
All ❌✅ (primary) -0.7% [-0.7%, -0.7%] 2

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
Regressions ❌
(secondary)
3.5% [1.9%, 5.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.0% [-1.1%, -0.8%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.0% [-1.1%, -0.8%] 3

Binary size

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
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 631.689s -> 631.334s (-0.06%)
Artifact size: 317.88 MiB -> 317.85 MiB (-0.01%)

@cjgillot cjgillot deleted the name-apit branch September 20, 2023 11:46
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.

6 participants