Page 10, found in 81 ms
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › … › mem › mod.rsmod.rs - source
More about rust.docs.kernel.org
… for FFI or unsafe code, but even 96 /// then, [`ManuallyDrop`] is typically preferred. 97 /// 98 /// Because forgetting a value is allowed, any `unsafe` code you write must 99 /// allow for this possibility …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › core › convert › trait.FromFrom in core::convert - Rust
More about rust.docs.kernel.org
… TryFromIntError 1.36.0 (const: unstable ) · Source § impl From < ! > for TryFromSliceError Source § impl From < Alignment > for NonZero < usize > Source § impl From < Alignment > for usize Source § impl From < AsciiChar > for char Source § impl From < AsciiChar …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › core › ptr › fn.from_reffrom_ref in core::ptr - Rust
More about rust.docs.kernel.org
Skip to main content from_ref core :: ptr Function from_ ref 1.76.0 (const: 1.76.0) · Source pub const fn from_ref<T: PointeeSized >(r: &T ) -> *const T Expand description Converts a reference to …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › … › io › enum.ErrorKindErrorKind in core::io - Rust
More about rust.docs.kernel.org
… here into your test code, and then match _ as the correct case. This seems counterintuitive, but it will make your tests more robust. In particular, if you want to verify that your …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › kernel › error › type.ResultResult in kernel::error - Rust
More about rust.docs.kernel.org
… represents a generic error code. We model those as Error . In Rust, it is idiomatic to model functions that may fail as returning a Result . Since in the kernel many functions return …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › kernel › pid_namespace › struct.PidNamespacePidNamespace in kernel::pid_namespace - Rust
More about rust.docs.kernel.org
… pid_namespace within Rust code that we get passed from the C side. Implementations § Source § impl PidNamespace Source pub fn as_ptr (&self) -> *mut pid_namespace Returns a raw pointer to the …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › core › macro.debug_assertdebug_assert in core - Rust
More about rust.docs.kernel.org
… only happens in safe code. The performance cost of assertions, however, is not measurable in general. Replacing assert! with debug_assert! is thus only encouraged after thorough profiling, and more importantly, only …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › … › cell › covariant_unsafe_cell.rscovariant_unsafe_cell.rs - source
More about rust.docs.kernel.org
… CovariantUnsafeCell<T>` requires `unsafe` code. 29 /// 30 /// # Examples 31 /// 32 /// ``` 33 /// #![feature(covariant_unsafe_cell)] 34 /// use std::cell::CovariantUnsafeCell; 35 /// 36 /// let uc = CovariantUnsafeCell::new(5); 37 /// ``` 38 #[unstable(feature = "covariant …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › … › mem › manually_drop.rsmanually_drop.rs - source
More about rust.docs.kernel.org
… github.com/rust-lang/unsafe-code-guidelines/issues/245). 100 /// That is, the following code caused undefined behavior: 101 /// 102 /// ```no_run 103 /// use std::mem::ManuallyDrop; 104 /// 105 /// let mut x = ManuallyDrop …
-
rust.docs.kernel.orghttps://rust.docs.kernel.org › … › cell › covariant_unsafe_cell.rscovariant_unsafe_cell.rs - source
More about rust.docs.kernel.org
… CovariantUnsafeCell<T>` requires `unsafe` code. 29 /// 30 /// # Examples 31 /// 32 /// ``` 33 /// #![feature(covariant_unsafe_cell)] 34 /// use std::cell::CovariantUnsafeCell; 35 /// 36 /// let uc = CovariantUnsafeCell::new(5); 37 /// ``` 38 #[unstable(feature = "covariant …
Search for “source code site:rust.docs.kernel.org” on Google, or add !ddg, !w and other shortcuts to any search.