Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C++ (Circle)
CIRCT
Clean
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Nim
Objective-C
Objective-C++
OCaml
OpenCL C
Pascal
Pony
Python
Racket
Ruby
Rust
Snowball
Scala
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
TypeScript Native
V
Vala
Visual Basic
WASM
Zig
Javascript
GIMPLE
Ygen
rust source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
mrustc (master)
rustc 1.0.0
rustc 1.1.0
rustc 1.10.0
rustc 1.11.0
rustc 1.12.0
rustc 1.13.0
rustc 1.14.0
rustc 1.15.1
rustc 1.16.0
rustc 1.17.0
rustc 1.18.0
rustc 1.19.0
rustc 1.2.0
rustc 1.20.0
rustc 1.21.0
rustc 1.22.0
rustc 1.23.0
rustc 1.24.0
rustc 1.25.0
rustc 1.26.0
rustc 1.27.0
rustc 1.27.1
rustc 1.28.0
rustc 1.29.0
rustc 1.3.0
rustc 1.30.0
rustc 1.31.0
rustc 1.32.0
rustc 1.33.0
rustc 1.34.0
rustc 1.35.0
rustc 1.36.0
rustc 1.37.0
rustc 1.38.0
rustc 1.39.0
rustc 1.4.0
rustc 1.40.0
rustc 1.41.0
rustc 1.42.0
rustc 1.43.0
rustc 1.44.0
rustc 1.45.0
rustc 1.45.2
rustc 1.46.0
rustc 1.47.0
rustc 1.48.0
rustc 1.49.0
rustc 1.5.0
rustc 1.50.0
rustc 1.51.0
rustc 1.52.0
rustc 1.53.0
rustc 1.54.0
rustc 1.55.0
rustc 1.56.0
rustc 1.57.0
rustc 1.58.0
rustc 1.59.0
rustc 1.6.0
rustc 1.60.0
rustc 1.61.0
rustc 1.62.0
rustc 1.63.0
rustc 1.64.0
rustc 1.65.0
rustc 1.66.0
rustc 1.67.0
rustc 1.68.0
rustc 1.69.0
rustc 1.7.0
rustc 1.70.0
rustc 1.71.0
rustc 1.72.0
rustc 1.73.0
rustc 1.74.0
rustc 1.75.0
rustc 1.76.0
rustc 1.77.0
rustc 1.78.0
rustc 1.79.0
rustc 1.8.0
rustc 1.80.0
rustc 1.81.0
rustc 1.82.0
rustc 1.9.0
rustc beta
rustc nightly
rustc-cg-gcc (master)
x86-64 GCCRS (GCC master)
x86-64 GCCRS (GCCRS master)
x86-64 GCCRS 14.1 (GCC)
x86-64 GCCRS 14.2 (GCC)
Options
Source code
use std::hint::black_box; pub fn main() { // Hack to prevent `rustc` from inling the `regular` function call let ptr: fn(_, _, _, _, _, _, _, _, _, _) -> u32 = regular; println!("{ptr:p}"); black_box(regular_bench()); } struct Point2D { x: u32, y: u32, } struct Point3D { x: u32, y: u32, z: u32, } pub fn regular_bench() -> u32 { let (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) = black_box(( Point3D { x: 4, y: 5, z: 6 }, 24, true, Some(Point2D { x: 55, y: 63 }), Some(6), &[ Point3D { x: 1, y: 2, z: 43 }, Point3D { x: 65, y: 43, z: 52, }, ], (10, 11), &[ Point2D { x: 12, y: 13 }, Point2D { x: 4, y: 0 }, Point2D { x: 1, y: 1 }, ], Point2D { x: 15, y: 16 }, Point3D { x: 17, y: 18, z: 19, }, )); regular(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) } fn regular( arg1: Point3D, arg2: u32, arg3: bool, arg4: Option<Point2D>, arg5: Option<u32>, arg6: &[Point3D], arg7: (u32, u32), arg8: &[Point2D], arg9: Point2D, arg10: Point3D, ) -> u32 { let x = arg1.x + arg1.y + arg1.z; let x = x + arg2; let x = x + u32::from(arg3); let x = x + arg4.map(|point| point.x * point.y).unwrap_or(0); let x = x + arg5.unwrap_or(0); let x = x + arg6 .iter() .map(|point| point.x + point.y * point.z) .sum::<u32>(); let x = x + arg7.0 + arg7.1 + arg8.iter().map(|point| point.x + point.y).sum::<u32>(); let x = x + arg9.x * arg9.y; let x = x + arg10.x * arg9.y * arg10.z; x }
rust source #2
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
mrustc (master)
rustc 1.0.0
rustc 1.1.0
rustc 1.10.0
rustc 1.11.0
rustc 1.12.0
rustc 1.13.0
rustc 1.14.0
rustc 1.15.1
rustc 1.16.0
rustc 1.17.0
rustc 1.18.0
rustc 1.19.0
rustc 1.2.0
rustc 1.20.0
rustc 1.21.0
rustc 1.22.0
rustc 1.23.0
rustc 1.24.0
rustc 1.25.0
rustc 1.26.0
rustc 1.27.0
rustc 1.27.1
rustc 1.28.0
rustc 1.29.0
rustc 1.3.0
rustc 1.30.0
rustc 1.31.0
rustc 1.32.0
rustc 1.33.0
rustc 1.34.0
rustc 1.35.0
rustc 1.36.0
rustc 1.37.0
rustc 1.38.0
rustc 1.39.0
rustc 1.4.0
rustc 1.40.0
rustc 1.41.0
rustc 1.42.0
rustc 1.43.0
rustc 1.44.0
rustc 1.45.0
rustc 1.45.2
rustc 1.46.0
rustc 1.47.0
rustc 1.48.0
rustc 1.49.0
rustc 1.5.0
rustc 1.50.0
rustc 1.51.0
rustc 1.52.0
rustc 1.53.0
rustc 1.54.0
rustc 1.55.0
rustc 1.56.0
rustc 1.57.0
rustc 1.58.0
rustc 1.59.0
rustc 1.6.0
rustc 1.60.0
rustc 1.61.0
rustc 1.62.0
rustc 1.63.0
rustc 1.64.0
rustc 1.65.0
rustc 1.66.0
rustc 1.67.0
rustc 1.68.0
rustc 1.69.0
rustc 1.7.0
rustc 1.70.0
rustc 1.71.0
rustc 1.72.0
rustc 1.73.0
rustc 1.74.0
rustc 1.75.0
rustc 1.76.0
rustc 1.77.0
rustc 1.78.0
rustc 1.79.0
rustc 1.8.0
rustc 1.80.0
rustc 1.81.0
rustc 1.82.0
rustc 1.9.0
rustc beta
rustc nightly
rustc-cg-gcc (master)
x86-64 GCCRS (GCC master)
x86-64 GCCRS (GCCRS master)
x86-64 GCCRS 14.1 (GCC)
x86-64 GCCRS 14.2 (GCC)
Options
Source code
use std::hint::black_box; pub fn main() { // Hack to prevent `rustc` from inling the `regular` function call let ptr: fn(_, _, _, _, _, _, _, _, _, _) -> u32 = regular; println!("{ptr:p}"); black_box(builder_bench()); } struct Point2D { x: u32, y: u32, } struct Point3D { x: u32, y: u32, z: u32, } pub fn builder_bench() -> u32 { let (arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) = black_box(( Point3D { x: 4, y: 5, z: 6 }, 24, true, Some(Point2D { x: 55, y: 63 }), Some(6), &[ Point3D { x: 1, y: 2, z: 43 }, Point3D { x: 65, y: 43, z: 52, }, ], (10, 11), &[ Point2D { x: 12, y: 13 }, Point2D { x: 4, y: 0 }, Point2D { x: 1, y: 1 }, ], Point2D { x: 15, y: 16 }, Point3D { x: 17, y: 18, z: 19, }, )); builder() .arg1(arg1) .arg2(arg2) .arg3(arg3) .maybe_arg4(arg4) .maybe_arg5(arg5) .arg6(arg6) .arg7(arg7) .arg8(arg8) .arg9(arg9) .arg10(arg10) .call() } // Recursive expansion of builder macro // ===================================== #[cfg(rust_analyzer)] const _: () = { mod builder_top_level { use self::{crate as _, start_fn as _}; use crate::bon::__::ide::builder_top_level::*; } mod builder_top_level_builder_type { use crate::bon::__::ide::builder_top_level::builder_type::*; } mod builder_top_level_start_fn { use crate::bon::__::ide::builder_top_level::start_fn::*; } mod builder_top_level_finish_fn { use crate::bon::__::ide::builder_top_level::finish_fn::*; } mod builder_top_level_state_mod { use crate::bon::__::ide::builder_top_level::state_mod::*; } mod builder_top_level_on { use crate::bon::__::ide::builder_top_level::on::*; } mod builder_top_level_derive { use crate::bon::__::ide::builder_top_level::derive::*; } }; #[allow(clippy::too_many_arguments, clippy::fn_params_excessive_bools)] fn regular( arg1: Point3D, arg2: u32, arg3: bool, arg4: Option<Point2D>, arg5: Option<u32>, arg6: &[Point3D], arg7: (u32, u32), arg8: &[Point2D], arg9: Point2D, arg10: Point3D, ) -> u32 { let x = arg1.x + arg1.y + arg1.z; let x = x + arg2; let x = x + u32::from(arg3); let x = x + arg4.map(|point| point.x * point.y).unwrap_or(0); let x = x + arg5.unwrap_or(0); let x = x + arg6 .iter() .map(|point| point.x + point.y * point.z) .sum::<u32>(); let x = x + arg7.0 + arg7.1 + arg8.iter().map(|point| point.x + point.y).sum::<u32>(); let x = x + arg9.x * arg9.y; let x = x + arg10.x * arg9.y * arg10.z; x } #[inline(always)] #[allow(clippy::inline_always, clippy::use_self, clippy::missing_const_for_fn)] #[allow(deprecated)] fn builder<'f1, 'f2>() -> RegularBuilder<'f1, 'f2> { RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: ::core::default::Default::default(), } } #[allow(unnameable_types, unreachable_pub, clippy::redundant_pub_crate)] #[doc = "Tools for manipulating the type state of [`RegularBuilder`].\n\nSee the [detailed guide](https://bon-rs.com/guide/typestate-api) that describes how all the pieces here fit together."] #[allow(deprecated)] mod regular_builder { #[doc(inline)] pub(super) use crate::bon::__::{IsSet, IsUnset}; use crate::bon::__::{Set, Unset}; mod sealed { pub(in super::super) struct Sealed; } #[doc = "Builder's type state specifies if members are set or not (unset).\n\nYou can use the associated types of this trait to control the state of individual members with the [`IsSet`] and [`IsUnset`] traits. You can change the state of the members with the `Set*` structs available in this module."] pub(super) trait State: ::core::marker::Sized { #[doc = "Type state of the member `arg1`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg1; #[doc = "Type state of the member `arg2`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg2; #[doc = "Type state of the member `arg3`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg3; #[doc = "Type state of the member `arg4`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg4; #[doc = "Type state of the member `arg5`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg5; #[doc = "Type state of the member `arg6`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg6; #[doc = "Type state of the member `arg7`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg7; #[doc = "Type state of the member `arg8`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg8; #[doc = "Type state of the member `arg9`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg9; #[doc = "Type state of the member `arg10`.\n\nIt can implement either [`IsSet`] or [`IsUnset`]"] type Arg10; #[doc(hidden)] const SEALED: sealed::Sealed; } #[doc = "Marker trait that indicates that all required members are set.\n\nIn this state, you can finish building by calling the method [`RegularBuilder::call()`](super::RegularBuilder::call())"] pub(super) trait IsComplete: State< Arg1: IsSet, Arg2: IsSet, Arg3: IsSet, Arg6: IsSet, Arg7: IsSet, Arg8: IsSet, Arg9: IsSet, Arg10: IsSet, > { #[doc(hidden)] const SEALED: sealed::Sealed; } #[doc(hidden)] impl<S: State> IsComplete for S where S::Arg1: IsSet, S::Arg2: IsSet, S::Arg3: IsSet, S::Arg6: IsSet, S::Arg7: IsSet, S::Arg8: IsSet, S::Arg9: IsSet, S::Arg10: IsSet, { const SEALED: sealed::Sealed = sealed::Sealed; } #[deprecated = "this should not be used directly; it is an implementation detail; use the Set* type aliases to control the state of members instead"] #[doc(hidden)] #[allow(non_camel_case_types)] mod members { pub(in super::super) enum arg1 {} pub(in super::super) enum arg2 {} pub(in super::super) enum arg3 {} pub(in super::super) enum arg4 {} pub(in super::super) enum arg5 {} pub(in super::super) enum arg6 {} pub(in super::super) enum arg7 {} pub(in super::super) enum arg8 {} pub(in super::super) enum arg9 {} pub(in super::super) enum arg10 {} } #[doc = r" Represents a [`State`] that has [`IsUnset`] implemented for all members."] #[doc = r""] #[doc = r" This is the initial state of the builder before any setters are called."] pub(super) struct Empty(()); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg1`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg1<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg2`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg2<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg3`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg3<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg4`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg4<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg5`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg5<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg6`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg6<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg7`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg7<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg8`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg8<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg9`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg9<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc = "Represents a [`State`] that has [`IsSet`] implemented for [`State::Arg10`].\n\nThe state for all other members is left the same as in the input state."] pub(super) struct SetArg10<S: State = Empty>(::core::marker::PhantomData<fn() -> S>); #[doc(hidden)] impl State for Empty { type Arg1 = Unset<members::arg1>; type Arg2 = Unset<members::arg2>; type Arg3 = Unset<members::arg3>; type Arg4 = Unset<members::arg4>; type Arg5 = Unset<members::arg5>; type Arg6 = Unset<members::arg6>; type Arg7 = Unset<members::arg7>; type Arg8 = Unset<members::arg8>; type Arg9 = Unset<members::arg9>; type Arg10 = Unset<members::arg10>; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg1<S> { type Arg1 = Set<members::arg1>; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg2<S> { type Arg1 = S::Arg1; type Arg2 = Set<members::arg2>; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg3<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = Set<members::arg3>; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg4<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = Set<members::arg4>; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg5<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = Set<members::arg5>; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg6<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = Set<members::arg6>; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg7<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = Set<members::arg7>; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg8<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = Set<members::arg8>; type Arg9 = S::Arg9; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg9<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = Set<members::arg9>; type Arg10 = S::Arg10; const SEALED: sealed::Sealed = sealed::Sealed; } #[doc(hidden)] impl<S: State> State for SetArg10<S> { type Arg1 = S::Arg1; type Arg2 = S::Arg2; type Arg3 = S::Arg3; type Arg4 = S::Arg4; type Arg5 = S::Arg5; type Arg6 = S::Arg6; type Arg7 = S::Arg7; type Arg8 = S::Arg8; type Arg9 = S::Arg9; type Arg10 = Set<members::arg10>; const SEALED: sealed::Sealed = sealed::Sealed; } } #[must_use = "the builder does nothing until you call `call()` on it to finish building"] #[doc = "Use builder syntax to set the inputs and finish with [`call()`](Self::call())."] #[allow(unused_parens)] #[allow(clippy::struct_field_names, clippy::type_complexity)] #[allow(deprecated)] struct RegularBuilder<'f1, 'f2, S: regular_builder::State = regular_builder::Empty> { #[doc(hidden)] #[deprecated = "this field should not be used directly; it's an implementation detail if you found yourself needing it, then you are probably doing something wrong; feel free to open an issue/discussion in our GitHub repository (https://github.com/elastio/bon) or ask for help in our Discord server (https://bon-rs.com/discord)"] __private_rainbow_phantom: ::core::marker::PhantomData<(fn() -> S,)>, #[doc(hidden)] #[deprecated = "this field should not be used directly; it's an implementation detail if you found yourself needing it, then you are probably doing something wrong; feel free to open an issue/discussion in our GitHub repository (https://github.com/elastio/bon) or ask for help in our Discord server (https://bon-rs.com/discord)"] __private_rainbow_named_members: ( ::core::option::Option<Point3D>, ::core::option::Option<u32>, ::core::option::Option<bool>, ::core::option::Option<Point2D>, ::core::option::Option<u32>, ::core::option::Option<&'f1 [Point3D]>, ::core::option::Option<(u32, u32)>, ::core::option::Option<&'f2 [Point2D]>, ::core::option::Option<Point2D>, ::core::option::Option<Point3D>, ), } #[allow(unused_parens)] #[automatically_derived] #[allow(deprecated)] impl<'f1, 'f2, S: regular_builder::State> RegularBuilder<'f1, 'f2, S> { #[doc = r" Finishes building and performs the requested action."] #[inline(always)] #[allow( clippy::inline_always, clippy::future_not_send, clippy::missing_const_for_fn )] fn call(self) -> u32 where S: regular_builder::IsComplete, { let arg1: Point3D = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.0) }; let arg2: u32 = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.1) }; let arg3: bool = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.2) }; let arg4: Option<Point2D> = self.__private_rainbow_named_members.3; let arg5: Option<u32> = self.__private_rainbow_named_members.4; let arg6: &'f1 [Point3D] = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.5) }; let arg7: (u32, u32) = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.6) }; let arg8: &'f2 [Point2D] = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.7) }; let arg9: Point2D = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.8) }; let arg10: Point3D = unsafe { ::core::option::Option::unwrap_unchecked(self.__private_rainbow_named_members.9) }; regular(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10) } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg1(mut self, value: Point3D) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg1<S>> where S::Arg1: regular_builder::IsUnset, { self.__private_rainbow_named_members.0 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg2(mut self, value: u32) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg2<S>> where S::Arg2: regular_builder::IsUnset, { self.__private_rainbow_named_members.1 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg3(mut self, value: bool) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg3<S>> where S::Arg3: regular_builder::IsUnset, { self.__private_rainbow_named_members.2 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Optional** |\n| -- |\n\n**See also** [`maybe_arg4()`](Self::maybe_arg4), which is a companion setter that accepts an `Option`.\n \n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg4(self, value: Point2D) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg4<S>> where S::Arg4: regular_builder::IsUnset, { self.maybe_arg4(Some(value)) } #[doc = "| **Optional** |\n| -- |\n\n**See also** [`arg4()`](Self::arg4), which is a companion setter that wraps the value with `Some` internally.\n \n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn maybe_arg4( mut self, value: Option<Point2D>, ) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg4<S>> where S::Arg4: regular_builder::IsUnset, { self.__private_rainbow_named_members.3 = value; RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Optional** |\n| -- |\n\n**See also** [`maybe_arg5()`](Self::maybe_arg5), which is a companion setter that accepts an `Option`.\n \n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg5(self, value: u32) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg5<S>> where S::Arg5: regular_builder::IsUnset, { self.maybe_arg5(Some(value)) } #[doc = "| **Optional** |\n| -- |\n\n**See also** [`arg5()`](Self::arg5), which is a companion setter that wraps the value with `Some` internally.\n \n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn maybe_arg5( mut self, value: Option<u32>, ) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg5<S>> where S::Arg5: regular_builder::IsUnset, { self.__private_rainbow_named_members.4 = value; RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg6( mut self, value: &'f1 [Point3D], ) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg6<S>> where S::Arg6: regular_builder::IsUnset, { self.__private_rainbow_named_members.5 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg7(mut self, value: (u32, u32)) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg7<S>> where S::Arg7: regular_builder::IsUnset, { self.__private_rainbow_named_members.6 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg8( mut self, value: &'f2 [Point2D], ) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg8<S>> where S::Arg8: regular_builder::IsUnset, { self.__private_rainbow_named_members.7 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg9(mut self, value: Point2D) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg9<S>> where S::Arg9: regular_builder::IsUnset, { self.__private_rainbow_named_members.8 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } #[doc = "| **Required** |\n| -- |\n\n"] #[allow( clippy::inline_always, clippy::impl_trait_in_params, clippy::missing_const_for_fn )] #[inline(always)] fn arg10(mut self, value: Point3D) -> RegularBuilder<'f1, 'f2, regular_builder::SetArg10<S>> where S::Arg10: regular_builder::IsUnset, { self.__private_rainbow_named_members.9 = ::core::option::Option::Some(value); RegularBuilder { __private_rainbow_phantom: ::core::marker::PhantomData, __private_rainbow_named_members: self.__private_rainbow_named_members, } } } mod bon { pub(crate) mod __ { #[derive(Debug)] pub(crate) struct Unset<Name>(Name); #[derive(Debug)] pub(crate) struct Set<Name>(Name); /// Marker trait that indicates that the member is set, i.e. at least /// one of its setters was called. pub(crate) trait IsSet {} /// Marker trait that indicates that the member is unset, i.e. none /// of its setters was called. pub(crate) trait IsUnset {} #[doc(hidden)] impl<Name> IsSet for Set<Name> {} #[doc(hidden)] impl<Name> IsUnset for Unset<Name> {} } }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
About the author
Statistics
Changelog
Version tree