pub enum Risk {
Show 28 variants
StringOffsets,
RegexSyntax,
DynamicRegex,
DynamicCode,
DynamicTyping,
OrderedCollections,
Exceptions,
Async,
Generators,
ClassInheritance,
Reflection,
Callbacks,
NumberSemantics,
Json,
IntegerSemantics,
DivisionSemantics,
UnorderedIteration,
Pointers,
Concurrency,
NullReferences,
Monkeypatching,
AlreadyCompiled,
ArrayParameters,
PlatformSpecific,
ClockAndRandom,
PipelineOutput,
CaseInsensitive,
LooseConversion,
}Expand description
A construct whose source-language semantics differ from the obvious Rust translation.
Variants§
StringOffsets
RegexSyntax
DynamicRegex
DynamicCode
DynamicTyping
OrderedCollections
Exceptions
Async
Generators
ClassInheritance
Reflection
Callbacks
NumberSemantics
Json
IntegerSemantics
Unbounded or differently sized integers (Python int, C/Go/Java widths and overflow).
DivisionSemantics
Floor division and modulo that differ from Rust’s (//, % on negatives, C / by zero).
UnorderedIteration
Iteration over hash sets or maps whose order a port cannot reproduce.
Pointers
Raw pointers, pointer arithmetic, manual memory.
Concurrency
Threads, goroutines, locks, shared mutable state.
NullReferences
Null references that any object value may hold (Java, Go nil, C NULL).
Monkeypatching
Changing classes, modules or methods at runtime (monkeypatching, method_missing).
AlreadyCompiled
Code already compiled to machine code (numba, Cython, JAX): Rust gains little speed.
ArrayParameters
Parameters typed as numpy arrays, which record cannot generate.
PlatformSpecific
C that depends on the target: inline assembly, volatile hardware access, bitfields,
packed layouts, compiler extensions, integers cast to addresses.
ClockAndRandom
Reads of the clock or random numbers, which change between runs.
PipelineOutput
PowerShell sends every uncaptured value to the pipeline and unrolls arrays on the way out.
CaseInsensitive
PowerShell’s -eq, -like, -match, -contains, switch and hashtable keys ignore case.
LooseConversion
PowerShell converts between types on its own: the left operand decides, / on integers
gives a double, an integer that overflows becomes a double, [int] rounds to even.
Implementations§
Trait Implementations§
impl Copy for Risk
impl Eq for Risk
Source§impl Ord for Risk
impl Ord for Risk
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Risk
impl PartialOrd for Risk
impl StructuralPartialEq for Risk
Auto Trait Implementations§
impl Forget for Risk
impl Freeze for Risk
impl Move for Risk
impl RefUnwindSafe for Risk
impl Send for Risk
impl Sync for Risk
impl Unpin for Risk
impl UnsafeUnpin for Risk
impl UnwindSafe for Risk
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.