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

Get rid of the lifetime on DataPayload/DataProvider/DataExporter #1297

Merged
merged 19 commits into from
Nov 15, 2021

Conversation

Manishearth
Copy link
Member

@Manishearth Manishearth commented Nov 15, 2021

Progress on #1262

RcStruct is now pretty useless but this PR doesn't yet remove it to reduce the amount of actual changes.

The actual changes here are:

  • DataPayload, DataProvider, DataExporter no longer have lifetimes (and as a result all the formatters/etc don't either)
  • It is no longer possible to construct data payloads from locally borrowed data
  • Tests testing for construction of providers/formatters from local data have been removed

Everything else is mostly just updates to bring the uses of these types in line with the changes

where
M: DataMarker,
{
RcStruct(Yoke<M::Yokeable, ErasedCart<'data>>),
RcStruct(Yoke<M::Yokeable, ErasedCart<'static>>),
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't remove the lifetime from ErasedCart since I'll probably do that when we remove RcStruct (and move ErasedStruct to yoke)

use crate::data_provider::{DataPayloadInner, ErasedCart};
let yoke: Yoke<_, ErasedCart> = match other.inner {
DataPayloadInner::RcStruct(yoke) => {
let rc: Rc<Yoke<_, _>> = Rc::from(yoke);
let yoke =
Yoke::attach_to_rc_cart(rc.clone() as Rc<dyn SerdeSeDataStruct<'data> + 'data>);
Yoke::attach_to_rc_cart(rc.clone() as Rc<dyn SerdeSeDataStruct<'static>>);
Copy link
Member

Choose a reason for hiding this comment

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

Request: Try to see if it's possible to get rid of the lifetime on SerdeSeDataStruct.

Copy link
Member Author

Choose a reason for hiding this comment

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

I plan to do this immediately in a followup, this change was not necessary to land the rest of this so I didn't do it.

@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/datetime/src/datetime.rs is different
  • components/datetime/src/zoned_datetime.rs is different
  • components/datetime/tests/datetime.rs is different
  • components/plurals/src/lib.rs is different
  • components/plurals/src/provider/resolver.rs is no longer changed in the branch
  • components/plurals/tests/plurals.rs is different
  • ffi/diplomat/src/pluralrules.rs is now changed in the branch
  • ffi/ecma402/src/pluralrules.rs is different
  • provider/cldr/src/transform/plurals.rs is different
  • provider/fs/tests/test_file_io.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

sffc
sffc previously approved these changes Nov 15, 2021
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/properties/src/maps.rs is different
  • provider/uprops/src/enum_codepointtrie.rs is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants