Page 10, found in 81 ms

  1. rust.docs.kernel.orghttps://rust.docs.kernel.org › … › mem › mod.rs
    More about rust.docs.kernel.org
    mod.rs - source

    … 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 …

    0 points
  2. rust.docs.kernel.orghttps://rust.docs.kernel.org › core › convert › trait.From
    More about rust.docs.kernel.org
    From in core::convert - Rust

    … 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 …

    0 points
  3. rust.docs.kernel.orghttps://rust.docs.kernel.org › core › ptr › fn.from_ref
    More about rust.docs.kernel.org
    from_ref in core::ptr - Rust

    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 …

    0 points
  4. rust.docs.kernel.orghttps://rust.docs.kernel.org › … › io › enum.ErrorKind
    More about rust.docs.kernel.org
    ErrorKind in core::io - Rust

    … 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 …

    0 points
  5. rust.docs.kernel.orghttps://rust.docs.kernel.org › kernel › error › type.Result
    More about rust.docs.kernel.org
    Result in kernel::error - Rust

    … 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 …

    0 points
  6. rust.docs.kernel.orghttps://rust.docs.kernel.org › kernel › pid_namespace › struct.PidNamespace
    More about rust.docs.kernel.org
    PidNamespace in kernel::pid_namespace - Rust

    … 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 …

    0 points
  7. rust.docs.kernel.orghttps://rust.docs.kernel.org › core › macro.debug_assert
    More about rust.docs.kernel.org
    debug_assert in core - Rust

    … 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 …

    0 points
  8. rust.docs.kernel.orghttps://rust.docs.kernel.org › … › cell › covariant_unsafe_cell.rs
    More about rust.docs.kernel.org
    covariant_unsafe_cell.rs - source

    … 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 …

    0 points
  9. rust.docs.kernel.orghttps://rust.docs.kernel.org › … › mem › manually_drop.rs
    More about rust.docs.kernel.org
    manually_drop.rs - source

    … 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 …

    0 points
  10. rust.docs.kernel.orghttps://rust.docs.kernel.org › … › cell › covariant_unsafe_cell.rs
    More about rust.docs.kernel.org
    covariant_unsafe_cell.rs - source

    … 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 …

    0 points

Search for “source code site:rust.docs.kernel.org” on Google, or add !ddg, !w and other shortcuts to any search.