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

delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions #122500

Merged
merged 2 commits into from
Apr 24, 2024

Conversation

petrochenkov
Copy link
Contributor

Also allow delegating to functions with opaque types (impl Trait).
The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created, which seems like a reasonable behavior.
(Such delegation items will cause query cycles when used in trait impls, but it can be fixed later.)

Part of #118212.

@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2024

r? @estebank

rustbot has assigned @estebank.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Mar 14, 2024
@compiler-errors
Copy link
Member

The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created, which seems like a reasonable behavior.

Yeah, that sounds right. It doesn't really matter because a new body can't be provided anyways.

@bors

This comment was marked as resolved.

@workingjubilee
Copy link
Member

pour one out for astconv.

@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 Mar 22, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 25, 2024

HIR ty lowering was modified

cc @fmease

@petrochenkov
Copy link
Contributor Author

@workingjubilee
Minor conflicts typically do not prevent reviews and do not require pre-review rebasing.
@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 Mar 25, 2024
@bors

This comment was marked as resolved.

@petrochenkov
Copy link
Contributor Author

ping @estebank, it's been 3 weeks.

@fmease
Copy link
Member

fmease commented Apr 4, 2024

I could review this within the next two days.

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

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

Thanks! Apologies for the super long delay. That shouldn't have happened.
Generally looks good. I have some small nitpicks.
After addressing them & a rebase, r=me.

compiler/rustc_ast_lowering/src/delegation.rs Outdated Show resolved Hide resolved
@@ -4712,12 +4713,13 @@ struct ItemInfoCollector<'a, 'b, 'tcx> {

impl ItemInfoCollector<'_, '_, '_> {
Copy link
Member

Choose a reason for hiding this comment

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

(preexisting) The name of ItemInfoCollector is pretty nondescript considering that it's fn_delegation-specific. I feel like we should make that more clear. Not blocking.

tests/ui/delegation/fn-header.rs Outdated Show resolved Hide resolved
tests/ui/delegation/fn-header.rs Show resolved Hide resolved
compiler/rustc_ast_lowering/src/delegation.rs Show resolved Hide resolved
compiler/rustc_ast_lowering/src/delegation.rs Outdated Show resolved Hide resolved
@fmease fmease 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 Apr 23, 2024
Also allow `impl Trait` in delegated functions.
The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created.
@petrochenkov
Copy link
Contributor Author

@bors r=fmease

@bors
Copy link
Contributor

bors commented Apr 23, 2024

📌 Commit 7b7c26f has been approved by fmease

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 23, 2024
fmease added a commit to fmease/rust that referenced this pull request Apr 24, 2024
delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions

Also allow delegating to functions with opaque types (`impl Trait`).
The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created, which seems like a reasonable behavior.
(Such delegation items will cause query cycles when used in trait impls, but it can be fixed later.)

Part of rust-lang#118212.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 6 pull requests

Successful merges:

 - rust-lang#122500 (delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions)
 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#124136 (Provide more context and suggestions in borrowck errors involving closures)
 - rust-lang#124280 (Port repr128-dwarf run-make test to rmake)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

r? `@ghost`
`@rustbot` modify labels: rollup
fmease added a commit to fmease/rust that referenced this pull request Apr 24, 2024
delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions

Also allow delegating to functions with opaque types (`impl Trait`).
The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created, which seems like a reasonable behavior.
(Such delegation items will cause query cycles when used in trait impls, but it can be fixed later.)

Part of rust-lang#118212.
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 24, 2024
Rollup of 5 pull requests

Successful merges:

 - rust-lang#122500 (delegation: Support renaming, and async, const, extern "ABI" and C-variadic functions)
 - rust-lang#123316 (Test `#[unix_sigpipe = "inherit"]` with both `SIG_DFL` and `SIG_IGN`)
 - rust-lang#123794 (More DefineOpaqueTypes::Yes)
 - rust-lang#124282 (windows fill_utf16_buf: explain the expected return value)
 - rust-lang#124308 (Add diagnostic item for `std::iter::Enumerate`)

Failed merges:

 - rust-lang#124136 (Provide more context and suggestions in borrowck errors involving closures)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Apr 24, 2024

⌛ Testing commit 7b7c26f with merge 5557f8c...

@bors
Copy link
Contributor

bors commented Apr 24, 2024

☀️ Test successful - checks-actions
Approved by: fmease
Pushing 5557f8c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2024
@bors bors merged commit 5557f8c into rust-lang:master Apr 24, 2024
13 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 24, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5557f8c): 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
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

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)
3.1% [3.0%, 3.5%] 4
Improvements ✅
(primary)
-2.6% [-2.7%, -2.5%] 2
Improvements ✅
(secondary)
-1.9% [-2.2%, -1.7%] 4
All ❌✅ (primary) -2.6% [-2.7%, -2.5%] 2

Binary size

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

Bootstrap: 672.79s -> 674.062s (0.19%)
Artifact size: 315.46 MiB -> 316.12 MiB (0.21%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-fn_delegation `#![feature(fn_delegation)]` 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.

8 participants