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

Implement Ratio to hold the ratio variable for Units Conversion #4834

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

younies
Copy link
Member

@younies younies commented Apr 22, 2024

No description provided.


// TODO(#4311).
/// Represents the numerator of the offset.
#[cfg_attr(feature = "serde", serde(borrow))]
pub offset_num: ZeroVec<'data, u8>,
pub offset: Ratio<'data>,
Copy link
Member Author

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant