Skip to content

partially move type outlives handling into trait solving #97641

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

Closed
wants to merge 8 commits into from

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Jun 2, 2022

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 2, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 2, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jun 2, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 2, 2022
@bors
Copy link
Collaborator

bors commented Jun 2, 2022

⌛ Trying commit e79af26 with merge b53ad5f2483f02c39bfe14104e375f804cbd1a14...

@bors
Copy link
Collaborator

bors commented Jun 2, 2022

💔 Test failed - checks-actions

@bors bors 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 Jun 2, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jun 2, 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
Collaborator

bors commented Jun 2, 2022

⌛ Trying commit dd0275a14a5639efe5513b4052b5747f534abe33 with merge d9bc44bb8c0843cdc8098318762cf7e779d43e5f...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 2, 2022

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

@rust-timer
Copy link
Collaborator

Queued d9bc44bb8c0843cdc8098318762cf7e779d43e5f with parent fb19760, future comparison URL.

@rust-log-analyzer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (d9bc44bb8c0843cdc8098318762cf7e779d43e5f): comparison url.

Instruction count

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
0.3% 0.3% 8
Regressions 😿
(secondary)
0.6% 0.9% 4
Improvements 🎉
(primary)
-0.2% -0.2% 1
Improvements 🎉
(secondary)
-0.5% -0.6% 6
All 😿🎉 (primary) 0.2% 0.3% 9

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
2.6% 2.6% 1
Regressions 😿
(secondary)
1.3% 1.6% 2
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.2% -2.2% 1
All 😿🎉 (primary) 2.6% 2.6% 1

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.0% 3.0% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 2, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Jun 2, 2022

cachegrind for regression-31157-Check-Full

 1,834,531  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor, rustc_data_structures::obligation_forest::Outcome<rustc_trait_selection::traits::fulfill::PendingPredicateObligation, rustc_infer::traits::FulfillmentErrorCode>>
-1,237,662  ???:<rustc_infer::infer::combine::Generalizer as rustc_middle::ty::relate::TypeRelation>::relate_with_variance::<rustc_middle::ty::subst::GenericArg>
   960,255  ???:<rustc_middle::ty::subst::GenericArg as rustc_middle::ty::relate::Relate>::relate::<rustc_infer::infer::combine::Generalizer>
   880,869  ???:<rustc_infer::infer::lexical_region_resolve::LexicalResolver>::infer_variable_values
  -857,849  ???:rustc_infer::infer::lexical_region_resolve::resolve
   820,728  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::compress::<<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations<rustc_trait_selection::traits::fulfill::FulfillProcessor, rustc_data_structures::obligation_forest::Outcome<rustc_trait_selection::traits::fulfill::PendingPredicateObligation, rustc_infer::traits::FulfillmentErrorCode>>::{closure
   662,607  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::apply_rewrites
  -564,995  ???:<rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::relate_with_variance::<rustc_middle::ty::subst::GenericArg>
   551,065  ???:<rustc_middle::ty::subst::GenericArg as rustc_middle::ty::relate::Relate>::relate::<rustc_infer::infer::equate::Equate>
  -445,653  ???:<rustc_middle::ty::subst::GenericArg>::walk_shallow
   432,159  ???:<rustc_middle::ty::context::CtxtInterners>::intern_predicate
   404,411  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::uninlined_mark_dependents_as_waiting
   342,809  ???:<rustc_trait_selection::traits::fulfill::FulfillProcessor>::process_changed_obligations
  -327,517  ???:<rustc_infer::infer::combine::CombineFields>::instantiate
   272,601  ???:<rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
   264,798  ???:<rustc_infer::infer::InferCtxt>::nested_outlives_obligations
  -182,764  ???:rustc_infer::infer::outlives::components::compute_components_recursive
   164,839  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::find_cycles_from_node::<rustc_trait_selection::traits::fulfill::FulfillProcessor>
   131,944  ???:<rustc_infer::infer::InferCtxt>::resolve_regions_and_report_errors
   123,166  ???:free
  -112,131  ???:<rustc_middle::ty::context::TyCtxt>::intern_substs
  -105,280  ???:<alloc::vec::Vec<(rustc_middle::ty::sty::RegionVid, rustc_middle::ty::sty::RegionVid)>>::retain::<<rustc_infer::infer::lexical_region_resolve::LexicalResolver>::expansion::{closure
    99,428  ???:<hashbrown::raw::RawTable<(rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>, ())>>::reserve_rehash::<hashbrown::map::make_hasher<rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>, rustc_middle::ty::ParamEnvAnd<rustc_middle::ty::Predicate>, (), core::hash::BuildHasherDefault<rustc_hash::FxHasher>>::{closure
    95,105  ???:malloc

@lcnr lcnr force-pushed the subtyping-sus branch from afc864a to 2b0b311 Compare June 8, 2022 07:03
@lcnr
Copy link
Contributor Author

lcnr commented Jun 8, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 8, 2022
@bors
Copy link
Collaborator

bors commented Jun 8, 2022

⌛ Trying commit 2b0b3119d9e574a3c7d296561e571c806a7b3d1b with merge 24d477a06bd06c22ae5041e196ebb2eceabca339...

@rust-timer
Copy link
Collaborator

Queued 48512925c982ea116a15d1c632e429f39d32129d with parent 64a7aa7, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (48512925c982ea116a15d1c632e429f39d32129d): comparison url.

Instruction count

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
0.2% 0.3% 5
Regressions 😿
(secondary)
0.5% 0.5% 2
Improvements 🎉
(primary)
-0.2% -0.3% 3
Improvements 🎉
(secondary)
-0.1% -0.1% 1
All 😿🎉 (primary) 0.1% 0.3% 8

Max RSS (memory usage)

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

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
3.9% 3.9% 1
Improvements 🎉
(primary)
-3.4% -3.4% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -3.4% -3.4% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 8, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jun 8, 2022

it's still slightly worse, though at a point where it's close to meaningless. One more improvement:

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

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

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 8, 2022
@bors
Copy link
Collaborator

bors commented Jun 8, 2022

⌛ Trying commit 1b4014705e47bdb61f275bfc1ff44f2842b37d7c with merge 3819c8a3730afd08cf40b3709a67b3f0e799b483...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Jun 8, 2022

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

@rust-timer
Copy link
Collaborator

Queued 3819c8a3730afd08cf40b3709a67b3f0e799b483 with parent 1a97162, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3819c8a3730afd08cf40b3709a67b3f0e799b483): comparison url.

Instruction count

  • Primary benchmarks: 🎉 relevant improvements found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
0.5% 0.5% 2
Improvements 🎉
(primary)
-0.3% -0.3% 6
Improvements 🎉
(secondary)
-0.2% -0.3% 2
All 😿🎉 (primary) -0.3% -0.3% 6

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.3% 3.3% 2
Improvements 🎉
(primary)
-2.5% -2.5% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -2.5% -2.5% 1

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: no relevant changes found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-2.3% -2.3% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -2.3% -2.3% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jun 8, 2022
@lcnr
Copy link
Contributor Author

lcnr commented Jun 8, 2022

alright, good enough for me not to bother, time to improve the diagnostics

@Dylan-DPC Dylan-DPC removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 22, 2022
Comment on lines +12 to +16
= note: but lifetime parameter must outlive the static lifetime

error: aborting due to previous error

For more information about this error, try `rustc --explain E0477`.
For more information about this error, try `rustc --explain E0478`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this PR could also fix E0478 to not show must outlive the static lifetime error message. See #41816.

@Dylan-DPC
Copy link
Member

@lcnr any updates on this?

@lcnr
Copy link
Contributor Author

lcnr commented Nov 14, 2022

not really, can close this for now

@lcnr lcnr closed this Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

10 participants