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

Separate the receiver from arguments in HIR #101261

Merged

Conversation

TaKO8Ki
Copy link
Member

@TaKO8Ki TaKO8Ki commented Sep 1, 2022

Related to #100232

cc @cjgillot

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Sep 1, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 1, 2022

Some changes occurred in need_type_info.rs

cc @lcnr

@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 1, 2022
@TaKO8Ki TaKO8Ki force-pushed the separate-receiver-from-arguments-in-hir branch from 780f9ee to 7bf59f5 Compare September 1, 2022 04:29
@rust-log-analyzer

This comment has been minimized.

@TaKO8Ki TaKO8Ki marked this pull request as draft September 1, 2022 07:40
@rust-log-analyzer

This comment has been minimized.

@TaKO8Ki TaKO8Ki marked this pull request as ready for review September 1, 2022 10:55
@rustbot
Copy link
Collaborator

rustbot commented Sep 1, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 1, 2022

@bors try

@bors
Copy link
Contributor

bors commented Sep 1, 2022

⌛ Trying commit e39e6badb9f814749efd5e90b3879934f65f701d with merge 49b7bc501896135473621bcd0af177b4fbab1a5e...

@bors
Copy link
Contributor

bors commented Sep 1, 2022

☀️ Try build successful - checks-actions
Build commit: 49b7bc501896135473621bcd0af177b4fbab1a5e (49b7bc501896135473621bcd0af177b4fbab1a5e)

@compiler-errors
Copy link
Member

cc #100427 i think

compiler/rustc_lint/src/array_into_iter.rs Outdated Show resolved Hide resolved
compiler/rustc_lint/src/methods.rs Outdated Show resolved Hide resolved
compiler/rustc_mir_build/src/thir/cx/expr.rs Outdated Show resolved Hide resolved
std::iter::once(receiver)
.chain(args.iter())
.rev()
.fold(succ, |succ, expr| self.propagate_through_expr(expr, succ))
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you inline the first iteration of the fold?

compiler/rustc_typeck/src/check/demand.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/len_zero.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/methods/clone_on_copy.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/minmax.rs Outdated Show resolved Hide resolved
compiler/rustc_lint/src/methods.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/methods/mod.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/methods/mod.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/methods/mod.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/methods/mod.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/methods/mod.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/minmax.rs Outdated Show resolved Hide resolved
std::iter::once(receiver).chain(args.iter()).collect()
} else {
args.iter().collect()
};
Copy link
Contributor

Choose a reason for hiding this comment

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

let args = receiver.into_iter().chain(args);

src/tools/clippy/clippy_lints/src/unused_peekable.rs Outdated Show resolved Hide resolved
@bors
Copy link
Contributor

bors commented Sep 1, 2022

☔ The latest upstream changes (presumably #101239) made this pull request unmergeable. Please resolve the merge conflicts.

@cjgillot cjgillot 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 2, 2022
@TaKO8Ki TaKO8Ki force-pushed the separate-receiver-from-arguments-in-hir branch from 6f36cef to 38e5074 Compare September 2, 2022 13:49
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 2, 2022

@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 2, 2022
Copy link
Contributor

@cjgillot cjgillot left a comment

Choose a reason for hiding this comment

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

This is not the simplification that we hoped for, but this makes the semantic much clearer, so let's go.
r=me with a few extra nits.

compiler/rustc_borrowck/src/diagnostics/region_errors.rs Outdated Show resolved Hide resolved
compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
src/tools/clippy/clippy_lints/src/eta_reduction.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented Sep 5, 2022

@bors try @rust-timer queue

@bors
Copy link
Contributor

bors commented Sep 5, 2022

☀️ Try build successful - checks-actions
Build commit: 25a8c2d85ec7bbe4e5a7071f9725b3b80ec9add3 (25a8c2d85ec7bbe4e5a7071f9725b3b80ec9add3)

@rust-timer
Copy link
Collaborator

Queued 25a8c2d85ec7bbe4e5a7071f9725b3b80ec9add3 with parent 406e03f, future comparison URL.

@TaKO8Ki TaKO8Ki force-pushed the separate-receiver-from-arguments-in-hir branch 2 times, most recently from e6d951b to 1351d82 Compare September 5, 2022 13:49
fix `ExprKind` static_assert_size

fix hir-stats
@TaKO8Ki TaKO8Ki force-pushed the separate-receiver-from-arguments-in-hir branch from 1351d82 to 9cde34e Compare September 5, 2022 14:11
@TaKO8Ki
Copy link
Member Author

TaKO8Ki commented Sep 5, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@bors
Copy link
Contributor

bors commented Sep 5, 2022

⌛ Trying commit 9cde34e with merge 39e7cded5d29175e5dbf01353888be348eab6285...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (25a8c2d85ec7bbe4e5a7071f9725b3b80ec9add3): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

Instruction count

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

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.2% [-1.3%, -1.1%] 2
Improvements ✅
(secondary)
-3.4% [-3.9%, -3.0%] 6
All ❌✅ (primary) -1.2% [-1.3%, -1.1%] 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.

mean1 range count2
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
2.4% [1.2%, 5.2%] 14
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 5, 2022
@bors
Copy link
Contributor

bors commented Sep 5, 2022

☀️ Try build successful - checks-actions
Build commit: 39e7cded5d29175e5dbf01353888be348eab6285 (39e7cded5d29175e5dbf01353888be348eab6285)

@cjgillot
Copy link
Contributor

cjgillot commented Sep 5, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Sep 5, 2022

📌 Commit 9cde34e has been approved by cjgillot

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 5, 2022
@bors
Copy link
Contributor

bors commented Sep 5, 2022

⌛ Testing commit 9cde34e with merge b44197a...

@bors
Copy link
Contributor

bors commented Sep 5, 2022

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing b44197a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 5, 2022
@bors bors merged commit b44197a into rust-lang:master Sep 5, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 5, 2022
@TaKO8Ki TaKO8Ki deleted the separate-receiver-from-arguments-in-hir branch September 5, 2022 19:18
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b44197a): 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.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [1.0%, 4.6%] 13
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.5% [-4.3%, -2.6%] 2
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.

mean1 range count2
Regressions ❌
(primary)
2.5% [2.5%, 2.5%] 1
Regressions ❌
(secondary)
2.6% [2.6%, 2.6%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.5% [2.5%, 2.5%] 1

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 9, 2022
…ents-in-hir, r=cjgillot

Separate the receiver from arguments in HIR

Related to rust-lang#100232

cc `@cjgillot`
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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet