[−][src]Struct syntax_ext::deriving::generic::MethodDef
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Fields
name: &'a str
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
name of the method
generics: LifetimeBounds<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
List of generics, e.g. R: rand::Rng
explicit_self: Option<Option<PtrTy<'a>>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Whether there is a self argument (outer Option) i.e. whether this is a static function, and whether it is a pointer (inner Option)
args: Vec<(Ty<'a>, &'a str)>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Arguments other than the self argument
ret_ty: Ty<'a>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Return type
attributes: Vec<Attribute>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
is_unsafe: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
unify_fieldless_variants: bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Can we combine fieldless variants for enums into a single match arm?
combine_substructure: RefCell<CombineSubstructureFunc<'a>>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Methods
impl<'a> MethodDef<'a>
[src]
impl<'a> MethodDef<'a>
fn call_substructure_method(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>],
fields: &SubstructureFields
) -> P<Expr>
[src]
fn call_substructure_method(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>],
fields: &SubstructureFields
) -> P<Expr>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn get_ret_ty(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
generics: &Generics,
type_ident: Ident
) -> P<Ty>
[src]
fn get_ret_ty(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
generics: &Generics,
type_ident: Ident
) -> P<Ty>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn is_static(&self) -> bool
[src]
fn is_static(&self) -> bool
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn split_self_nonself_args(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
type_ident: Ident,
generics: &Generics
) -> (Option<ExplicitSelf>, Vec<P<Expr>>, Vec<P<Expr>>, Vec<(Ident, P<Ty>)>)
[src]
fn split_self_nonself_args(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
type_ident: Ident,
generics: &Generics
) -> (Option<ExplicitSelf>, Vec<P<Expr>>, Vec<P<Expr>>, Vec<(Ident, P<Ty>)>)
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn create_method(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
type_ident: Ident,
generics: &Generics,
abi: Abi,
explicit_self: Option<ExplicitSelf>,
arg_types: Vec<(Ident, P<Ty>)>,
body: P<Expr>
) -> ImplItem
[src]
fn create_method(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
type_ident: Ident,
generics: &Generics,
abi: Abi,
explicit_self: Option<ExplicitSelf>,
arg_types: Vec<(Ident, P<Ty>)>,
body: P<Expr>
) -> ImplItem
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn expand_struct_method_body<'b>(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef<'b>,
struct_def: &'b VariantData,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>],
use_temporaries: bool
) -> P<Expr>
[src]
fn expand_struct_method_body<'b>(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef<'b>,
struct_def: &'b VariantData,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>],
use_temporaries: bool
) -> P<Expr>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
#[derive(PartialEq)] struct A { x: i32, y: i32 } // equivalent to: impl PartialEq for A { fn eq(&self, other: &A) -> bool { match *self { A {x: ref __self_0_0, y: ref __self_0_1} => { match *other { A {x: ref __self_1_0, y: ref __self_1_1} => { __self_0_0.eq(__self_1_0) && __self_0_1.eq(__self_1_1) } } } } } } // or if A is repr(packed) - note fields are matched by-value // instead of by-reference. impl PartialEq for A { fn eq(&self, other: &A) -> bool { match *self { A {x: __self_0_0, y: __self_0_1} => { match other { A {x: __self_1_0, y: __self_1_1} => { __self_0_0.eq(&__self_1_0) && __self_0_1.eq(&__self_1_1) } } } } } }
fn expand_static_struct_method_body(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
struct_def: &VariantData,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>]
) -> P<Expr>
[src]
fn expand_static_struct_method_body(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
struct_def: &VariantData,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>]
) -> P<Expr>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
fn expand_enum_method_body<'b>(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef<'b>,
enum_def: &'b EnumDef,
type_attrs: &[Attribute],
type_ident: Ident,
self_args: Vec<P<Expr>>,
nonself_args: &[P<Expr>]
) -> P<Expr>
[src]
fn expand_enum_method_body<'b>(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef<'b>,
enum_def: &'b EnumDef,
type_attrs: &[Attribute],
type_ident: Ident,
self_args: Vec<P<Expr>>,
nonself_args: &[P<Expr>]
) -> P<Expr>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
#[derive(PartialEq)] enum A { A1, A2(i32) } // is equivalent to impl PartialEq for A { fn eq(&self, other: &A) -> ::bool { match (&*self, &*other) { (&A1, &A1) => true, (&A2(ref self_0), &A2(ref __arg_1_0)) => (*self_0).eq(&(*__arg_1_0)), _ => { let __self_vi = match *self { A1(..) => 0, A2(..) => 1 }; let __arg_1_vi = match *other { A1(..) => 0, A2(..) => 1 }; false } } } }
(Of course __self_vi
and __arg_1_vi
are unused for
PartialEq
, and those subcomputations will hopefully be removed
as their results are unused. The point of __self_vi
and
__arg_1_vi
is for PartialOrd
; see #15503.)
fn build_enum_match_tuple<'b>(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef<'b>,
enum_def: &'b EnumDef,
type_attrs: &[Attribute],
type_ident: Ident,
self_args: Vec<P<Expr>>,
nonself_args: &[P<Expr>]
) -> P<Expr>
[src]
fn build_enum_match_tuple<'b>(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef<'b>,
enum_def: &'b EnumDef,
type_attrs: &[Attribute],
type_ident: Ident,
self_args: Vec<P<Expr>>,
nonself_args: &[P<Expr>]
) -> P<Expr>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Creates a match for a tuple of all self_args
, where either all
variants match, or it falls into a catch-all for when one variant
does not match.
There are N + 1 cases because is a case for each of the N
variants where all of the variants match, and one catch-all for
when one does not match.
As an optimization we generate code which checks whether all variants
match first which makes llvm see that C-like enums can be compiled into
a simple equality check (for PartialEq).
The catch-all handler is provided access the variant index values
for each of the self-args, carried in precomputed variables.
let __self0_vi = unsafe {
std::intrinsics::discriminant_value(&self) } as i32;
let __self1_vi = unsafe {
std::intrinsics::discriminant_value(&arg1) } as i32;
let __self2_vi = unsafe {
std::intrinsics::discriminant_value(&arg2) } as i32;
if __self0_vi == __self1_vi && __self0_vi == __self2_vi && ... {
match (...) {
(Variant1, Variant1, ...) => Body1
(Variant2, Variant2, ...) => Body2,
...
_ => ::core::intrinsics::unreachable()
}
}
else {
... // catch-all remainder can inspect above variant index values.
}
fn expand_static_enum_method_body(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
enum_def: &EnumDef,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>]
) -> P<Expr>
[src]
fn expand_static_enum_method_body(
&self,
cx: &mut ExtCtxt,
trait_: &TraitDef,
enum_def: &EnumDef,
type_ident: Ident,
self_args: &[P<Expr>],
nonself_args: &[P<Expr>]
) -> P<Expr>
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
[src]
fn not_found<S, T>(trait_name: &'static str, method_name: &'static str) -> E where
T: ?Sized,
🔬 This is a nightly-only experimental API. (rustc_private
)
this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml
instead?
Create an error for a missing method specialization. Defaults to panicking with type, trait & method names. S
is the encoder/decoder state type, T
is the type being encoded/decoded, and the arguments are the names of the trait and method that should've been overridden. Read more
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T