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

Deny hashing ty/re/ct inference variables #103220

Merged
merged 4 commits into from
Oct 20, 2022

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Oct 19, 2022

cc @cjgillot and #102695 (comment)
r? @lcnr

best reviewed one commit at a time, mostly because the second commit that fixes ClosureOutlivesRequirement is mostly noise because of losing its <'tcx> lifetime parameter.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 19, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 19, 2022
@@ -1,22 +1,23 @@
error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-72312.rs:12:9
--> $DIR/issue-72312.rs:12:24
Copy link
Member Author

Choose a reason for hiding this comment

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

This UI test changes its output because we used to sort ClosureOutlivesRequirements by Option<Ty<'tcx>> but now sort by Location, thus we now use the span of the first location in the body, which corresponds to the innermost call.

I don't think this is necessarily an issue, though. The error is more readable, imo.

@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

the same should hold for const infer vars

let stable_hash = if flags.flags.intersects(TypeFlags::HAS_RE_INFER)
let stable_hash = if flags
.flags
.intersects(TypeFlags::HAS_RE_INFER | TypeFlags::HAS_TY_INFER)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.intersects(TypeFlags::HAS_RE_INFER | TypeFlags::HAS_TY_INFER)
.intersects(TypeFlags::HAS_RE_INFER | TypeFlags::HAS_TY_INFER | TypeFlags::HAS_CT_INFER)

@lcnr
Copy link
Contributor

lcnr commented Oct 19, 2022

once we also forbid const infer vars

r=me

@bors
Copy link
Contributor

bors commented Oct 19, 2022

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

@rustbot rustbot added the A-testsuite Area: The testsuite used to check the correctness of rustc label Oct 19, 2022
@compiler-errors compiler-errors changed the title Deny hashing type and region inference variables Deny hashing ty/re/ct inference variables Oct 19, 2022
@compiler-errors
Copy link
Member Author

@bors r=lcnr rollup=iffy

@bors
Copy link
Contributor

bors commented Oct 19, 2022

📌 Commit 6b0ef9c has been approved by lcnr

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

bors commented Oct 20, 2022

⌛ Testing commit 6b0ef9c with merge 4b3b731...

@bors
Copy link
Contributor

bors commented Oct 20, 2022

☀️ Test successful - checks-actions
Approved by: lcnr
Pushing 4b3b731 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 20, 2022
@bors bors merged commit 4b3b731 into rust-lang:master Oct 20, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 20, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4b3b731): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.8% [0.5%, 1.2%] 8
Improvements ✅
(primary)
-0.2% [-0.3%, -0.2%] 2
Improvements ✅
(secondary)
-0.9% [-1.0%, -0.5%] 9
All ❌✅ (primary) -0.2% [-0.3%, -0.2%] 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)
- - 0
Regressions ❌
(secondary)
4.5% [2.1%, 6.8%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.6%, -2.4%] 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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.5%, -1.9%] 3
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added the perf-regression Performance regression. label Oct 20, 2022
@compiler-errors
Copy link
Member Author

I have no idea why this would introduce a regression 🤔

@nnethercote
Copy link
Contributor

The perf changes are small and the wins balance out the losses. No need to stress on this one, I think.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Oct 25, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 28, 2022
…gillot

Don't carry MIR location in `ConstraintCategory::CallArgument`

It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies.

So instead, revert the commit a6b5f95, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in rust-lang#103220.

Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen.

Fixes rust-lang#103624
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 28, 2022
…gillot

Don't carry MIR location in `ConstraintCategory::CallArgument`

It turns out that `ConstraintCategory::CallArgument` cannot just carry a MIR location in it, since we may bubble them up to totally different MIR bodies.

So instead, revert the commit a6b5f95, and instead just erase regions from the original `Option<Ty<'tcx>>` that it carried, so that it doesn't ICE with the changes in rust-lang#103220.

Best reviewed in parts -- the first is just a revert, and the second is where the meaningful changes happen.

Fixes rust-lang#103624
@compiler-errors compiler-errors deleted the deny-infers branch November 2, 2022 02:54
Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
Deny hashing ty/re/ct inference variables

cc `@cjgillot` and rust-lang#102695 (comment)
r? `@lcnr`

best reviewed one commit at a time, mostly because the second commit that fixes `ClosureOutlivesRequirement` is mostly noise because of losing its `<'tcx>` lifetime parameter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. 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