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

Fix the .shorten() method in SerdeDataStructWrap #760

Closed
sffc opened this issue Jun 4, 2021 · 2 comments · Fixed by #1040 or #1041
Closed

Fix the .shorten() method in SerdeDataStructWrap #760

sffc opened this issue Jun 4, 2021 · 2 comments · Fixed by #1040 or #1041
Assignees
Labels
C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) T-techdebt Type: ICU4X code health and tech debt

Comments

@sffc
Copy link
Member

sffc commented Jun 4, 2021

There is the following method on SerdeSeDataStructWrap:

impl<'d, 's: 'd> SerdeSeDataStructWrap<'d, 's> {
    fn shorten(self) -> SerdeSeDataStructWrap<'d, 'd> {
        // This is safe because 's exceeds 'd
        // TODO(#760): The types must be covariant for this to actually be safe.
        unsafe { std::mem::transmute(self) }
    }
}

This is a follow-up from #745 (comment) to re-work this code so it doesn't need unsafe.

Blocked on #752

@sffc sffc added blocked A dependency must be resolved before this is actionable C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) T-bug Type: Bad behavior, security, privacy T-techdebt Type: ICU4X code health and tech debt and removed T-bug Type: Bad behavior, security, privacy labels Jun 4, 2021
@sffc sffc added the discuss Discuss at a future ICU4X-SC meeting label Jun 4, 2021
@sffc sffc self-assigned this Jun 10, 2021
@sffc sffc removed the discuss Discuss at a future ICU4X-SC meeting label Jun 10, 2021
@sffc sffc added this to the ICU4X 0.3 milestone Jun 10, 2021
@sffc
Copy link
Member Author

sffc commented Jun 10, 2021

Should be obsolete based on #752.

Update: It doesn't appear that #752 made this obsolete.

@sffc sffc modified the milestones: ICU4X 0.3, 2021 Q3-m1 Jul 13, 2021
@sffc sffc modified the milestones: 2021 Q3-m1, 2021 Q3 0.4 Sprint B Aug 11, 2021
@sffc sffc removed the blocked A dependency must be resolved before this is actionable label Sep 8, 2021
@sffc sffc closed this as completed in #1040 Sep 9, 2021
@sffc
Copy link
Member Author

sffc commented Sep 10, 2021

Not completely fixed; still need #1041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-data-infra Component: provider, datagen, fallback, adapters S-small Size: One afternoon (small bug fix or enhancement) T-techdebt Type: ICU4X code health and tech debt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant