Lines Matching full:let

48 //! let foo = pin_init!(Foo {
67 //! # let foo = pin_init!(Foo {
71 //! let foo: Result<Pin<Box<Foo>>> = Box::pin_init(foo);
83 //! let mtx: Result<Arc<Mutex<usize>>> = Arc::pin_init(new_mutex!(42, "example::mtx"));
161 //! let foo = addr_of_mut!((*slot).foo);
167 //! let err = bindings::enable_foo(Opaque::raw_get(foo), flags);
254 /// stack_pin_init!(let foo = pin_init!(Foo {
260 /// let foo: Pin<&mut Foo> = foo;
266 /// A normal `let` binding with optional type annotation. The expression is expected to implement
273 (let $var:ident $(: $t:ty)? = $val:expr) => {
274 let val = $val;
275 let mut $var = ::core::pin::pin!($crate::init::__internal::StackInit$(::<$t>)?::uninit());
276 let mut $var = match $crate::init::__internal::StackInit::init($var, val) {
279 let x: ::core::convert::Infallible = x;
306 /// stack_try_pin_init!(let foo: Result<Pin<&mut Foo>, AllocError> = pin_init!(Foo {
312 /// let foo = foo.unwrap();
332 /// stack_try_pin_init!(let foo: Pin<&mut Foo> =? pin_init!(Foo {
344 /// A normal `let` binding with optional type annotation. The expression is expected to implement
349 (let $var:ident $(: $t:ty)? = $val:expr) => {
350 let val = $val;
351 let mut $var = ::core::pin::pin!($crate::init::__internal::StackInit$(::<$t>)?::uninit());
352 let mut $var = $crate::init::__internal::StackInit::init($var, val);
354 (let $var:ident $(: $t:ty)? =? $val:expr) => {
355 let val = $val;
356 let mut $var = ::core::pin::pin!($crate::init::__internal::StackInit$(::<$t>)?::uninit());
357 let mut $var = $crate::init::__internal::StackInit::init($var, val)?;
384 /// let a = 42;
386 /// let initializer = pin_init!(Foo {
406 /// When working with this API it is often desired to let others construct your types without
463 /// let foo = Box::pin_init(Foo::new());
807 /// let foo = pin_init!(Foo {
842 let val = unsafe { &mut *slot }; in __pinned_init()
844 let val = unsafe { Pin::new_unchecked(val) }; in __pinned_init()
913 /// let foo = init!(Foo {
1016 /// let array: Box<[usize; 1_000]>= Box::init::<Error>(init_array_from_fn(|i| i)).unwrap();
1025 let init = move |slot: *mut [T; N]| {
1026 let slot = slot.cast::<T>();
1029 let mut init_count = ScopeGuard::new_with_data(0, |i| {
1037 let init = make_init(i);
1039 let ptr = unsafe { slot.add(i) };
1059 /// let array: Arc<[Mutex<usize>; 1_000]>=
1069 let init = move |slot: *mut [T; N]| {
1070 let slot = slot.cast::<T>();
1073 let mut init_count = ScopeGuard::new_with_data(0, |i| {
1081 let init = make_init(i);
1083 let ptr = unsafe { slot.add(i) };
1131 let init = unsafe { in pin_init()
1148 let init = unsafe { in init()
1161 let mut this = Box::try_new_uninit()?; in try_pin_init()
1162 let slot = this.as_mut_ptr(); in try_pin_init()
1175 let mut this = Box::try_new_uninit()?; in try_init()
1176 let slot = this.as_mut_ptr(); in try_init()
1191 let mut this = UniqueArc::try_new_uninit()?; in try_pin_init()
1192 let slot = this.as_mut_ptr(); in try_pin_init()
1205 let mut this = UniqueArc::try_new_uninit()?; in try_init()
1206 let slot = this.as_mut_ptr(); in try_init()
1262 /// let val: Self = unsafe { core::mem::zeroed() };