pub enum Goal {
Speed,
Size,
}Expand description
Which of a target’s two tables is wanted.
A named type rather than a bare bool, because table(true) at a call site is a coin toss for
the reader and table(Goal::Size) is not.
Variants§
Implementations§
Source§impl Goal
impl Goal
Sourcepub const fn for_size(size: bool) -> Self
pub const fn for_size(size: bool) -> Self
The goal for a level that has already been asked whether it optimizes for size.
Takes the answer rather than the level, because the level lives in rucc-session and this
crate sits below it. That is not a workaround for the layer rule, it is the layer rule
working: what an instruction costs on a machine has nothing to do with how the driver was
invoked, and a dependency the other way would say it did. The caller writes
Goal::for_size(level.is_size()), which is one line and reads correctly.
Trait Implementations§
impl Copy for Goal
impl Eq for Goal
Source§impl Ord for Goal
impl Ord for Goal
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Goal
impl PartialOrd for Goal
impl StructuralPartialEq for Goal
Auto Trait Implementations§
impl Freeze for Goal
impl RefUnwindSafe for Goal
impl Send for Goal
impl Sync for Goal
impl Unpin for Goal
impl UnsafeUnpin for Goal
impl UnwindSafe for Goal
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more