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

even more unify Projection/Opaque handling in region outlives code #106910

Merged
merged 2 commits into from
Jan 19, 2023

Conversation

aliemjay
Copy link
Member

@aliemjay aliemjay commented Jan 15, 2023

edit: This continues ate the same pace as #106829. New changes are described in #106910 (comment).

This touches OutlivesBound, Component, GenericKind enums.

r? @oli-obk (because of overlap with #95474)

@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 Jan 15, 2023
@compiler-errors
Copy link
Member

lol, this basically duplicates #106829 I think?

@aliemjay
Copy link
Member Author

aliemjay commented Jan 15, 2023

Wow, what a strange coincidence!

@compiler-errors I think we can land yours first, and then I will update mine based on that. This is because this PR contains more involved changes, specifically the EscapingAlias change, which should fix an ICE in the following snippet (this reminds me to add a test):

#![feature(type_alias_impl_trait)]
type Ty<'a> = impl Sized + 'a;
fn define<'a>() -> Ty<'a> {}
fn test(_: &'static fn(Ty<'_>)) {}

Additionally this also introduces AliasTy::{kind,to_ty} which allows us to get rid of AliasKind.

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jan 16, 2023
@bors
Copy link
Contributor

bors commented Jan 17, 2023

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

@oli-obk oli-obk removed the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Jan 17, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Jan 17, 2023

@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 Jan 17, 2023
@aliemjay aliemjay changed the title merge projection and opaque type variants in regionck enums even more unify Projection/Opaque handling in region outlives code Jan 17, 2023
@aliemjay
Copy link
Member Author

@rustbot review

@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 Jan 17, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Jan 17, 2023

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 17, 2023
@bors
Copy link
Contributor

bors commented Jan 17, 2023

⌛ Trying commit c35bb812b7cd528357431e0230b06c5c5aa44212 with merge f97eeb789fd11a48395ace4b27510fc2adf64869...

@oli-obk
Copy link
Contributor

oli-obk commented Jan 17, 2023

@bors delegate+

r=me with perf clean

@bors
Copy link
Contributor

bors commented Jan 17, 2023

✌️ @aliemjay can now approve this pull request

@bors
Copy link
Contributor

bors commented Jan 17, 2023

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

1 similar comment
@bors
Copy link
Contributor

bors commented Jan 17, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f97eeb789fd11a48395ace4b27510fc2adf64869): comparison URL.

Overall result: ❌ regressions - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -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.

mean range count
Regressions ❌
(primary)
0.5% [0.4%, 0.5%] 4
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [0.4%, 0.5%] 4

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)
2.2% [2.2%, 2.3%] 2
Improvements ✅
(primary)
-1.5% [-2.1%, -0.8%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.5% [-2.1%, -0.8%] 2

Cycles

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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 17, 2023
@oli-obk
Copy link
Contributor

oli-obk commented Jan 18, 2023

A small regression in diesel. We should cachegrind it to see if it's something obvious

@oli-obk
Copy link
Contributor

oli-obk commented Jan 19, 2023

Cachegrind says

113,350,107  ???:<alloc::vec::Vec<rustc_middle::ty::sty::Binder<rustc_middle::ty::OutlivesPredicate<rustc_middle::ty::Ty, rustc_middle::ty::sty::Region>>> as alloc::vec::spec_from_iter::SpecFromIter<rustc_middle::ty::sty::Binder<rustc_middle::ty::OutlivesPredicate<rustc_middle::ty::Ty, rustc_middle::ty::sty::Region>>, core::iter::adapters::inspect::Inspect<core::iter::adapters::chain::Chain<core::iter::adapters::filter::Filter<core::iter::adapters::filter_map::FilterMap<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Predicate>>, <rustc_infer::infer::outlives::verify::VerifyBoundCx>::collect_outlives_from_predicate_list<core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_middle::ty::Predicate>>>::{closure
-64,527,904  ???:<rustc_infer::infer::outlives::verify::VerifyBoundCx>::param_bound
 14,731,334  ???:<rustc_middle::ty::subst::SubstFolder as rustc_middle::ty::fold::FallibleTypeFolder>::try_fold_ty
-13,297,583  ???:<rustc_borrowck::constraint_generation::ConstraintGeneration as rustc_middle::mir::visit::Visitor>::visit_basic_block_data
 10,924,743  ???:<rustc_infer::infer::at::At as rustc_trait_selection::traits::project::NormalizeExt>::normalize::<rustc_middle::ty::InstantiatedPredicates>
 10,799,485  ???:rustc_borrowck::constraint_generation::generate_constraints
-10,150,298  ???:<rustc_middle::ty::InstantiatedPredicates as rustc_middle::ty::fold::TypeFoldable>::fold_with::<rustc_infer::infer::resolve::OpportunisticVarResolver>
  9,251,025  ???:<rustc_trait_selection::traits::fulfill::FulfillmentContext as rustc_infer::traits::engine::TraitEngine>::register_predicate_obligation
  8,900,919  ???:<rustc_middle::ty::subst::GenericArg as rustc_middle::ty::fold::TypeFoldable>::try_fold_with::<rustc_infer::infer::resolve::OpportunisticVarResolver>
  7,595,609  ???:<rustc_middle::ty::sty::AliasTy>::to_ty
 -7,301,243  ???:<rustc_infer::infer::outlives::verify::VerifyBoundCx>::projection_opaque_bounds
  6,529,401  ???:<rustc_infer::infer::outlives::verify::VerifyBoundCx>::alias_bound

I don't think there's really anything actionable here, and we should land regardless.

@bors r+

@bors
Copy link
Contributor

bors commented Jan 19, 2023

📌 Commit e40567b has been approved by oli-obk

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 Jan 19, 2023
@bors
Copy link
Contributor

bors commented Jan 19, 2023

⌛ Testing commit e40567b with merge 19423b5...

@bors
Copy link
Contributor

bors commented Jan 19, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 19423b5 to master...

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

Finished benchmarking commit (19423b5): comparison URL.

Overall result: ❌✅ regressions and 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.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) 0.4% [0.4%, 0.4%] 1

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)
4.1% [4.1%, 4.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.2% [-2.2%, -2.2%] 1
All ❌✅ (primary) - - 0

Cycles

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

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.

7 participants