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
Implement Ratio to hold the ratio variable for Units Conversion #4834
Draft
younies
wants to merge
5
commits into
unicode-org:main
Choose a base branch
from
younies:dev-icu-ratio-datagen
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
younies
commented
Apr 23, 2024
|
||
// TODO(#4311). | ||
/// Represents the numerator of the offset. | ||
#[cfg_attr(feature = "serde", serde(borrow))] | ||
pub offset_num: ZeroVec<'data, u8>, | ||
pub offset: Ratio<'data>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error: field `factor` has no lifetimes to borrow
--> components/experimental/src/units/provider.rs:81:5
|
81 | / /// Represents the numerator of the conversion factor.
82 | | #[cfg_attr(feature = "serde", serde(borrow))]
83 | | pub factor: RatioULE,
| |________________________^
error: field `offset` has no lifetimes to borrow
--> components/experimental/src/units/provider.rs:86:5
|
86 | / /// Represents the numerator of the offset.
87 | | #[cfg_attr(feature = "serde", serde(borrow))]
88 | | pub offset: RatioULE,
| |________________________^
warning: unused import: `alloc::borrow::Cow`
--> components/experimental/src/units/provider.rs:12:5
|
12 | use alloc::borrow::Cow;
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> components/experimental/src/units/provider.rs:83:17
|
83 | pub factor: RatioULE,
| ^^^^^^^^ doesn't have a size known at compile-time
|
= help: within `RatioULE`, the trait `Sized` is not implemented for `[u8]`, which is required by `RatioULE: Sized`
note: required because it appears within the type `RatioULE`
--> components/experimental/src/units/provider.rs:94:24
|
94 | #[zerovec::make_varule(RatioULE)]
| ^^^^^^^^
= note: only the last field of a struct may have a dynamically sized type
= help: change the field's type to have a statically known size
help: borrowed types always have a statically known size
|
83 | pub factor: &RatioULE,
| +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
83 | pub factor: Box<RatioULE>,
| ++++ +
error[E0277]: the trait bound `RatioULE: AsULE` is not satisfied
--> components/experimental/src/units/provider.rs:58:1
|
58 | #[zerovec::make_varule(ConversionInfoULE)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsULE` is not implemented for `RatioULE`
|
= help: the following other types implement trait `AsULE`:
bool
char
i8
i16
i32
i64
i128
u8
and 55 others
= note: this error originates in the attribute macro `zerovec::make_varule` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `RatioULE: AsULE` is not satisfied
--> components/experimental/src/units/provider.rs:83:17
|
83 | pub factor: RatioULE,
| ^^^^^^^^ the trait `AsULE` is not implemented for `RatioULE`
|
= help: the following other types implement trait `AsULE`:
bool
char
i8
i16
i32
i64
i128
u8
and 55 others
error[E0277]: the trait bound `RatioULE: AsULE` is not satisfied
--> components/experimental/src/units/provider.rs:88:17
|
88 | pub offset: RatioULE,
| ^^^^^^^^ the trait `AsULE` is not implemented for `RatioULE`
|
= help: the following other types implement trait `AsULE`:
bool
char
i8
i16
i32
i64
i128
u8
and 55 others
For more information about this error, try `rustc --explain E0277`.
warning: `icu_experimental` (lib) generated 1 warning
error: could not compile `icu_experimental` (lib) due to 10 previous errors; 1 warning emitted
warning: build failed, waiting for other jobs to finish...
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.