Remove unnecessary sigils and ref
s in derived code.
E.g. improving code like this: ``` match &*self { &Enum1::Single { x: ref __self_0 } => { ::core:#️⃣:Hash::hash(&*__self_0, state) } } ``` to this: ``` match self { Enum1::Single { x: __self_0 } => { ::core:#️⃣:Hash::hash(&*__self_0, state) } } ``` by removing the `&*`, the `&`, and the `ref`. I suspect the current generated code predates deref-coercion. The commit also gets rid of `use_temporaries`, instead passing around `always_copy`, which makes things a little clearer. And it fixes up some comments.
This commit is contained in:
parent
f314ece275
commit
277bc9641d
3 changed files with 161 additions and 197 deletions
|
@ -183,7 +183,6 @@ use rustc_ast::ptr::P;
|
||||||
use rustc_ast::{self as ast, BinOpKind, EnumDef, Expr, Generics, PatKind};
|
use rustc_ast::{self as ast, BinOpKind, EnumDef, Expr, Generics, PatKind};
|
||||||
use rustc_ast::{GenericArg, GenericParamKind, VariantData};
|
use rustc_ast::{GenericArg, GenericParamKind, VariantData};
|
||||||
use rustc_attr as attr;
|
use rustc_attr as attr;
|
||||||
use rustc_data_structures::map_in_place::MapInPlace;
|
|
||||||
use rustc_expand::base::{Annotatable, ExtCtxt};
|
use rustc_expand::base::{Annotatable, ExtCtxt};
|
||||||
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
use rustc_span::symbol::{kw, sym, Ident, Symbol};
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
|
@ -455,7 +454,6 @@ impl<'a> TraitDef<'a> {
|
||||||
};
|
};
|
||||||
let container_id = cx.current_expansion.id.expn_data().parent.expect_local();
|
let container_id = cx.current_expansion.id.expn_data().parent.expect_local();
|
||||||
let always_copy = has_no_type_params && cx.resolver.has_derive_copy(container_id);
|
let always_copy = has_no_type_params && cx.resolver.has_derive_copy(container_id);
|
||||||
let use_temporaries = is_packed && always_copy;
|
|
||||||
|
|
||||||
let newitem = match item.kind {
|
let newitem = match item.kind {
|
||||||
ast::ItemKind::Struct(ref struct_def, ref generics) => self.expand_struct_def(
|
ast::ItemKind::Struct(ref struct_def, ref generics) => self.expand_struct_def(
|
||||||
|
@ -464,11 +462,11 @@ impl<'a> TraitDef<'a> {
|
||||||
item.ident,
|
item.ident,
|
||||||
generics,
|
generics,
|
||||||
from_scratch,
|
from_scratch,
|
||||||
use_temporaries,
|
|
||||||
is_packed,
|
is_packed,
|
||||||
|
always_copy,
|
||||||
),
|
),
|
||||||
ast::ItemKind::Enum(ref enum_def, ref generics) => {
|
ast::ItemKind::Enum(ref enum_def, ref generics) => {
|
||||||
// We ignore `use_temporaries` here, because
|
// We ignore `is_packed`/`always_copy` here, because
|
||||||
// `repr(packed)` enums cause an error later on.
|
// `repr(packed)` enums cause an error later on.
|
||||||
//
|
//
|
||||||
// This can only cause further compilation errors
|
// This can only cause further compilation errors
|
||||||
|
@ -484,8 +482,8 @@ impl<'a> TraitDef<'a> {
|
||||||
item.ident,
|
item.ident,
|
||||||
generics,
|
generics,
|
||||||
from_scratch,
|
from_scratch,
|
||||||
use_temporaries,
|
|
||||||
is_packed,
|
is_packed,
|
||||||
|
always_copy,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
cx.span_err(mitem.span, "this trait cannot be derived for unions");
|
cx.span_err(mitem.span, "this trait cannot be derived for unions");
|
||||||
|
@ -766,8 +764,8 @@ impl<'a> TraitDef<'a> {
|
||||||
type_ident: Ident,
|
type_ident: Ident,
|
||||||
generics: &Generics,
|
generics: &Generics,
|
||||||
from_scratch: bool,
|
from_scratch: bool,
|
||||||
use_temporaries: bool,
|
|
||||||
is_packed: bool,
|
is_packed: bool,
|
||||||
|
always_copy: bool,
|
||||||
) -> P<ast::Item> {
|
) -> P<ast::Item> {
|
||||||
let field_tys: Vec<P<ast::Ty>> =
|
let field_tys: Vec<P<ast::Ty>> =
|
||||||
struct_def.fields().iter().map(|field| field.ty.clone()).collect();
|
struct_def.fields().iter().map(|field| field.ty.clone()).collect();
|
||||||
|
@ -795,8 +793,8 @@ impl<'a> TraitDef<'a> {
|
||||||
type_ident,
|
type_ident,
|
||||||
&selflike_args,
|
&selflike_args,
|
||||||
&nonselflike_args,
|
&nonselflike_args,
|
||||||
use_temporaries,
|
|
||||||
is_packed,
|
is_packed,
|
||||||
|
always_copy,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -937,9 +935,7 @@ impl<'a> MethodDef<'a> {
|
||||||
|
|
||||||
match ty {
|
match ty {
|
||||||
// Selflike (`&Self`) arguments only occur in non-static methods.
|
// Selflike (`&Self`) arguments only occur in non-static methods.
|
||||||
Ref(box Self_, _) if !self.is_static() => {
|
Ref(box Self_, _) if !self.is_static() => selflike_args.push(arg_expr),
|
||||||
selflike_args.push(cx.expr_deref(span, arg_expr))
|
|
||||||
}
|
|
||||||
Self_ => cx.span_bug(span, "`Self` in non-return position"),
|
Self_ => cx.span_bug(span, "`Self` in non-return position"),
|
||||||
_ => nonselflike_args.push(arg_expr),
|
_ => nonselflike_args.push(arg_expr),
|
||||||
}
|
}
|
||||||
|
@ -1025,9 +1021,9 @@ impl<'a> MethodDef<'a> {
|
||||||
/// # struct A { x: i32, y: i32 }
|
/// # struct A { x: i32, y: i32 }
|
||||||
/// impl PartialEq for A {
|
/// impl PartialEq for A {
|
||||||
/// fn eq(&self, other: &A) -> bool {
|
/// fn eq(&self, other: &A) -> bool {
|
||||||
/// let Self { x: ref __self_0_0, y: ref __self_0_1 } = *self;
|
/// let Self { x: __self_0_0, y: __self_0_1 } = *self;
|
||||||
/// let Self { x: ref __self_1_0, y: ref __self_1_1 } = *other;
|
/// let Self { x: __self_1_0, y: __self_1_1 } = *other;
|
||||||
/// *__self_0_0 == *__self_1_0 && *__self_0_1 == *__self_1_1
|
/// __self_0_0 == __self_1_0 && __self_0_1 == __self_1_1
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -1039,8 +1035,8 @@ impl<'a> MethodDef<'a> {
|
||||||
type_ident: Ident,
|
type_ident: Ident,
|
||||||
selflike_args: &[P<Expr>],
|
selflike_args: &[P<Expr>],
|
||||||
nonselflike_args: &[P<Expr>],
|
nonselflike_args: &[P<Expr>],
|
||||||
use_temporaries: bool,
|
|
||||||
is_packed: bool,
|
is_packed: bool,
|
||||||
|
always_copy: bool,
|
||||||
) -> BlockOrExpr {
|
) -> BlockOrExpr {
|
||||||
let span = trait_.span;
|
let span = trait_.span;
|
||||||
assert!(selflike_args.len() == 1 || selflike_args.len() == 2);
|
assert!(selflike_args.len() == 1 || selflike_args.len() == 2);
|
||||||
|
@ -1062,23 +1058,21 @@ impl<'a> MethodDef<'a> {
|
||||||
} else {
|
} else {
|
||||||
let prefixes: Vec<_> =
|
let prefixes: Vec<_> =
|
||||||
(0..selflike_args.len()).map(|i| format!("__self_{}", i)).collect();
|
(0..selflike_args.len()).map(|i| format!("__self_{}", i)).collect();
|
||||||
|
let no_deref = always_copy;
|
||||||
let selflike_fields =
|
let selflike_fields =
|
||||||
trait_.create_struct_pattern_fields(cx, struct_def, &prefixes, use_temporaries);
|
trait_.create_struct_pattern_fields(cx, struct_def, &prefixes, no_deref);
|
||||||
let mut body = mk_body(cx, selflike_fields);
|
let mut body = mk_body(cx, selflike_fields);
|
||||||
|
|
||||||
let struct_path = cx.path(span, vec![Ident::new(kw::SelfUpper, type_ident.span)]);
|
let struct_path = cx.path(span, vec![Ident::new(kw::SelfUpper, type_ident.span)]);
|
||||||
let patterns = trait_.create_struct_patterns(
|
let use_ref_pat = is_packed && !always_copy;
|
||||||
cx,
|
let patterns =
|
||||||
struct_path,
|
trait_.create_struct_patterns(cx, struct_path, struct_def, &prefixes, use_ref_pat);
|
||||||
struct_def,
|
|
||||||
&prefixes,
|
|
||||||
use_temporaries,
|
|
||||||
);
|
|
||||||
|
|
||||||
// Do the let-destructuring.
|
// Do the let-destructuring.
|
||||||
let mut stmts: Vec<_> = iter::zip(selflike_args, patterns)
|
let mut stmts: Vec<_> = iter::zip(selflike_args, patterns)
|
||||||
.map(|(selflike_arg_expr, pat)| {
|
.map(|(selflike_arg_expr, pat)| {
|
||||||
cx.stmt_let_pat(span, pat, selflike_arg_expr.clone())
|
let selflike_arg_expr = cx.expr_deref(span, selflike_arg_expr.clone());
|
||||||
|
cx.stmt_let_pat(span, pat, selflike_arg_expr)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
stmts.extend(std::mem::take(&mut body.0));
|
stmts.extend(std::mem::take(&mut body.0));
|
||||||
|
@ -1118,18 +1112,16 @@ impl<'a> MethodDef<'a> {
|
||||||
/// impl ::core::cmp::PartialEq for A {
|
/// impl ::core::cmp::PartialEq for A {
|
||||||
/// #[inline]
|
/// #[inline]
|
||||||
/// fn eq(&self, other: &A) -> bool {
|
/// fn eq(&self, other: &A) -> bool {
|
||||||
/// {
|
/// let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
/// let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
/// let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
/// let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
/// if __self_vi == __arg_1_vi {
|
||||||
/// if true && __self_vi == __arg_1_vi {
|
/// match (self, other) {
|
||||||
/// match (&*self, &*other) {
|
/// (A::A2(__self_0), A::A2(__arg_1_0)) =>
|
||||||
/// (&A::A2(ref __self_0), &A::A2(ref __arg_1_0)) =>
|
/// *__self_0 == *__arg_1_0,
|
||||||
/// (*__self_0) == (*__arg_1_0),
|
/// _ => true,
|
||||||
/// _ => true,
|
|
||||||
/// }
|
|
||||||
/// } else {
|
|
||||||
/// false // catch-all handler
|
|
||||||
/// }
|
/// }
|
||||||
|
/// } else {
|
||||||
|
/// false // catch-all handler
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
|
@ -1202,27 +1194,20 @@ impl<'a> MethodDef<'a> {
|
||||||
// A single arm has form (&VariantK, &VariantK, ...) => BodyK
|
// A single arm has form (&VariantK, &VariantK, ...) => BodyK
|
||||||
// (see "Final wrinkle" note below for why.)
|
// (see "Final wrinkle" note below for why.)
|
||||||
|
|
||||||
let use_temporaries = false; // enums can't be repr(packed)
|
let no_deref = false; // because enums can't be repr(packed)
|
||||||
let fields = trait_.create_struct_pattern_fields(
|
let fields =
|
||||||
cx,
|
trait_.create_struct_pattern_fields(cx, &variant.data, &prefixes, no_deref);
|
||||||
&variant.data,
|
|
||||||
&prefixes,
|
|
||||||
use_temporaries,
|
|
||||||
);
|
|
||||||
|
|
||||||
let sp = variant.span.with_ctxt(trait_.span.ctxt());
|
let sp = variant.span.with_ctxt(trait_.span.ctxt());
|
||||||
let variant_path = cx.path(sp, vec![type_ident, variant.ident]);
|
let variant_path = cx.path(sp, vec![type_ident, variant.ident]);
|
||||||
let mut subpats: Vec<_> = trait_
|
let use_ref_pat = false; // because enums can't be repr(packed)
|
||||||
.create_struct_patterns(
|
let mut subpats: Vec<_> = trait_.create_struct_patterns(
|
||||||
cx,
|
cx,
|
||||||
variant_path,
|
variant_path,
|
||||||
&variant.data,
|
&variant.data,
|
||||||
&prefixes,
|
&prefixes,
|
||||||
use_temporaries,
|
use_ref_pat,
|
||||||
)
|
);
|
||||||
.into_iter()
|
|
||||||
.map(|p| cx.pat(span, PatKind::Ref(p, ast::Mutability::Not)))
|
|
||||||
.collect();
|
|
||||||
|
|
||||||
// Here is the pat = `(&VariantK, &VariantK, ...)`
|
// Here is the pat = `(&VariantK, &VariantK, ...)`
|
||||||
let single_pat = if subpats.len() == 1 {
|
let single_pat = if subpats.len() == 1 {
|
||||||
|
@ -1302,25 +1287,23 @@ impl<'a> MethodDef<'a> {
|
||||||
// Build a series of let statements mapping each selflike_arg
|
// Build a series of let statements mapping each selflike_arg
|
||||||
// to its discriminant value.
|
// to its discriminant value.
|
||||||
//
|
//
|
||||||
// i.e., for `enum E<T> { A, B(1), C(T, T) }`, and a deriving
|
// i.e., for `enum E<T> { A, B(1), C(T, T) }` for `PartialEq::eq`,
|
||||||
// with three Self args, builds three statements:
|
// builds two statements:
|
||||||
// ```
|
// ```
|
||||||
// let __self_vi = std::intrinsics::discriminant_value(&self);
|
// let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
// let __arg_1_vi = std::intrinsics::discriminant_value(&arg1);
|
// let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
// let __arg_2_vi = std::intrinsics::discriminant_value(&arg2);
|
|
||||||
// ```
|
// ```
|
||||||
let mut index_let_stmts: Vec<ast::Stmt> = Vec::with_capacity(vi_idents.len() + 1);
|
let mut index_let_stmts: Vec<ast::Stmt> = Vec::with_capacity(vi_idents.len() + 1);
|
||||||
|
|
||||||
// We also build an expression which checks whether all discriminants are equal:
|
// We also build an expression which checks whether all discriminants are equal, e.g.
|
||||||
// `__self_vi == __arg_1_vi && __self_vi == __arg_2_vi && ...`
|
// `__self_vi == __arg_1_vi`.
|
||||||
let mut discriminant_test = cx.expr_bool(span, true);
|
let mut discriminant_test = cx.expr_bool(span, true);
|
||||||
for (i, (&ident, selflike_arg)) in iter::zip(&vi_idents, &selflike_args).enumerate() {
|
for (i, (&ident, selflike_arg)) in iter::zip(&vi_idents, &selflike_args).enumerate() {
|
||||||
let selflike_addr = cx.expr_addr_of(span, selflike_arg.clone());
|
|
||||||
let variant_value = deriving::call_intrinsic(
|
let variant_value = deriving::call_intrinsic(
|
||||||
cx,
|
cx,
|
||||||
span,
|
span,
|
||||||
sym::discriminant_value,
|
sym::discriminant_value,
|
||||||
vec![selflike_addr],
|
vec![selflike_arg.clone()],
|
||||||
);
|
);
|
||||||
let let_stmt = cx.stmt_let(span, false, ident, variant_value);
|
let let_stmt = cx.stmt_let(span, false, ident, variant_value);
|
||||||
index_let_stmts.push(let_stmt);
|
index_let_stmts.push(let_stmt);
|
||||||
|
@ -1347,17 +1330,11 @@ impl<'a> MethodDef<'a> {
|
||||||
)
|
)
|
||||||
.into_expr(cx, span);
|
.into_expr(cx, span);
|
||||||
|
|
||||||
// Final wrinkle: the selflike_args are expressions that deref
|
|
||||||
// down to desired places, but we cannot actually deref
|
|
||||||
// them when they are fed as r-values into a tuple
|
|
||||||
// expression; here add a layer of borrowing, turning
|
|
||||||
// `(*self, *__arg_0, ...)` into `(&*self, &*__arg_0, ...)`.
|
|
||||||
selflike_args.map_in_place(|selflike_arg| cx.expr_addr_of(span, selflike_arg));
|
|
||||||
let match_arg = cx.expr(span, ast::ExprKind::Tup(selflike_args));
|
let match_arg = cx.expr(span, ast::ExprKind::Tup(selflike_args));
|
||||||
|
|
||||||
// Lastly we create an expression which branches on all discriminants being equal
|
// Lastly we create an expression which branches on all discriminants being equal, e.g.
|
||||||
// if discriminant_test {
|
// if __self_vi == _arg_1_vi {
|
||||||
// match (...) {
|
// match (self, other) {
|
||||||
// (Variant1, Variant1, ...) => Body1
|
// (Variant1, Variant1, ...) => Body1
|
||||||
// (Variant2, Variant2, ...) => Body2,
|
// (Variant2, Variant2, ...) => Body2,
|
||||||
// ...
|
// ...
|
||||||
|
@ -1376,12 +1353,6 @@ impl<'a> MethodDef<'a> {
|
||||||
// for the zero variant case.
|
// for the zero variant case.
|
||||||
BlockOrExpr(vec![], Some(deriving::call_unreachable(cx, span)))
|
BlockOrExpr(vec![], Some(deriving::call_unreachable(cx, span)))
|
||||||
} else {
|
} else {
|
||||||
// Final wrinkle: the selflike_args are expressions that deref
|
|
||||||
// down to desired places, but we cannot actually deref
|
|
||||||
// them when they are fed as r-values into a tuple
|
|
||||||
// expression; here add a layer of borrowing, turning
|
|
||||||
// `(*self, *__arg_0, ...)` into `(&*self, &*__arg_0, ...)`.
|
|
||||||
selflike_args.map_in_place(|selflike_arg| cx.expr_addr_of(span, selflike_arg));
|
|
||||||
let match_arg = if selflike_args.len() == 1 {
|
let match_arg = if selflike_args.len() == 1 {
|
||||||
selflike_args.pop().unwrap()
|
selflike_args.pop().unwrap()
|
||||||
} else {
|
} else {
|
||||||
|
@ -1451,7 +1422,7 @@ impl<'a> TraitDef<'a> {
|
||||||
struct_path: ast::Path,
|
struct_path: ast::Path,
|
||||||
struct_def: &'a VariantData,
|
struct_def: &'a VariantData,
|
||||||
prefixes: &[String],
|
prefixes: &[String],
|
||||||
use_temporaries: bool,
|
use_ref_pat: bool,
|
||||||
) -> Vec<P<ast::Pat>> {
|
) -> Vec<P<ast::Pat>> {
|
||||||
prefixes
|
prefixes
|
||||||
.iter()
|
.iter()
|
||||||
|
@ -1459,10 +1430,10 @@ impl<'a> TraitDef<'a> {
|
||||||
let pieces_iter =
|
let pieces_iter =
|
||||||
struct_def.fields().iter().enumerate().map(|(i, struct_field)| {
|
struct_def.fields().iter().enumerate().map(|(i, struct_field)| {
|
||||||
let sp = struct_field.span.with_ctxt(self.span.ctxt());
|
let sp = struct_field.span.with_ctxt(self.span.ctxt());
|
||||||
let binding_mode = if use_temporaries {
|
let binding_mode = if use_ref_pat {
|
||||||
ast::BindingMode::ByValue(ast::Mutability::Not)
|
|
||||||
} else {
|
|
||||||
ast::BindingMode::ByRef(ast::Mutability::Not)
|
ast::BindingMode::ByRef(ast::Mutability::Not)
|
||||||
|
} else {
|
||||||
|
ast::BindingMode::ByValue(ast::Mutability::Not)
|
||||||
};
|
};
|
||||||
let ident = self.mk_pattern_ident(prefix, i);
|
let ident = self.mk_pattern_ident(prefix, i);
|
||||||
let path = ident.with_span_pos(sp);
|
let path = ident.with_span_pos(sp);
|
||||||
|
@ -1541,7 +1512,7 @@ impl<'a> TraitDef<'a> {
|
||||||
cx: &mut ExtCtxt<'_>,
|
cx: &mut ExtCtxt<'_>,
|
||||||
struct_def: &'a VariantData,
|
struct_def: &'a VariantData,
|
||||||
prefixes: &[String],
|
prefixes: &[String],
|
||||||
use_temporaries: bool,
|
no_deref: bool,
|
||||||
) -> Vec<FieldInfo> {
|
) -> Vec<FieldInfo> {
|
||||||
self.create_fields(struct_def, |i, _struct_field, sp| {
|
self.create_fields(struct_def, |i, _struct_field, sp| {
|
||||||
prefixes
|
prefixes
|
||||||
|
@ -1549,7 +1520,7 @@ impl<'a> TraitDef<'a> {
|
||||||
.map(|prefix| {
|
.map(|prefix| {
|
||||||
let ident = self.mk_pattern_ident(prefix, i);
|
let ident = self.mk_pattern_ident(prefix, i);
|
||||||
let expr = cx.expr_path(cx.path_ident(sp, ident));
|
let expr = cx.expr_path(cx.path_ident(sp, ident));
|
||||||
if use_temporaries { expr } else { cx.expr_deref(sp, expr) }
|
if no_deref { expr } else { cx.expr_deref(sp, expr) }
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
|
@ -1564,11 +1535,7 @@ impl<'a> TraitDef<'a> {
|
||||||
self.create_fields(struct_def, |i, struct_field, sp| {
|
self.create_fields(struct_def, |i, struct_field, sp| {
|
||||||
selflike_args
|
selflike_args
|
||||||
.iter()
|
.iter()
|
||||||
.map(|mut selflike_arg| {
|
.map(|selflike_arg| {
|
||||||
// We don't the need the deref, if there is one.
|
|
||||||
if let ast::ExprKind::Unary(ast::UnOp::Deref, inner) = &selflike_arg.kind {
|
|
||||||
selflike_arg = inner;
|
|
||||||
}
|
|
||||||
// Note: we must use `struct_field.span` rather than `span` in the
|
// Note: we must use `struct_field.span` rather than `span` in the
|
||||||
// `unwrap_or_else` case otherwise the hygiene is wrong and we get
|
// `unwrap_or_else` case otherwise the hygiene is wrong and we get
|
||||||
// "field `0` of struct `Point` is private" errors on tuple
|
// "field `0` of struct `Point` is private" errors on tuple
|
||||||
|
|
|
@ -196,9 +196,8 @@ impl Bounds {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_explicit_self(cx: &ExtCtxt<'_>, span: Span) -> (P<Expr>, ast::ExplicitSelf) {
|
pub fn get_explicit_self(cx: &ExtCtxt<'_>, span: Span) -> (P<Expr>, ast::ExplicitSelf) {
|
||||||
// this constructs a fresh `self` path
|
// This constructs a fresh `self` path.
|
||||||
let self_path = cx.expr_self(span);
|
let self_path = cx.expr_self(span);
|
||||||
let self_ty = respan(span, SelfKind::Region(None, ast::Mutability::Not));
|
let self_ty = respan(span, SelfKind::Region(None, ast::Mutability::Not));
|
||||||
let self_expr = cx.expr_deref(span, self_path);
|
(self_path, self_ty)
|
||||||
(self_expr, self_ty)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -675,8 +675,8 @@ enum Enum1 {
|
||||||
impl ::core::clone::Clone for Enum1 {
|
impl ::core::clone::Clone for Enum1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> Enum1 {
|
fn clone(&self) -> Enum1 {
|
||||||
match &*self {
|
match self {
|
||||||
&Enum1::Single { x: ref __self_0 } =>
|
Enum1::Single { x: __self_0 } =>
|
||||||
Enum1::Single { x: ::core::clone::Clone::clone(&*__self_0) },
|
Enum1::Single { x: ::core::clone::Clone::clone(&*__self_0) },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -685,8 +685,8 @@ impl ::core::clone::Clone for Enum1 {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::fmt::Debug for Enum1 {
|
impl ::core::fmt::Debug for Enum1 {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||||
match &*self {
|
match self {
|
||||||
&Enum1::Single { x: ref __self_0 } =>
|
Enum1::Single { x: __self_0 } =>
|
||||||
::core::fmt::Formatter::debug_struct_field1_finish(f,
|
::core::fmt::Formatter::debug_struct_field1_finish(f,
|
||||||
"Single", "x", &&*__self_0),
|
"Single", "x", &&*__self_0),
|
||||||
}
|
}
|
||||||
|
@ -696,8 +696,8 @@ impl ::core::fmt::Debug for Enum1 {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::hash::Hash for Enum1 {
|
impl ::core::hash::Hash for Enum1 {
|
||||||
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
||||||
match &*self {
|
match self {
|
||||||
&Enum1::Single { x: ref __self_0 } => {
|
Enum1::Single { x: __self_0 } => {
|
||||||
::core::hash::Hash::hash(&*__self_0, state)
|
::core::hash::Hash::hash(&*__self_0, state)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -709,16 +709,16 @@ impl ::core::marker::StructuralPartialEq for Enum1 {}
|
||||||
impl ::core::cmp::PartialEq for Enum1 {
|
impl ::core::cmp::PartialEq for Enum1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &Enum1) -> bool {
|
fn eq(&self, other: &Enum1) -> bool {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Enum1::Single { x: ref __self_0 }, &Enum1::Single {
|
(Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg_1_0 }) =>
|
||||||
x: ref __arg_1_0 }) => *__self_0 == *__arg_1_0,
|
*__self_0 == *__arg_1_0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn ne(&self, other: &Enum1) -> bool {
|
fn ne(&self, other: &Enum1) -> bool {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Enum1::Single { x: ref __self_0 }, &Enum1::Single {
|
(Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg_1_0 }) =>
|
||||||
x: ref __arg_1_0 }) => *__self_0 != *__arg_1_0,
|
*__self_0 != *__arg_1_0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -739,9 +739,8 @@ impl ::core::cmp::PartialOrd for Enum1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn partial_cmp(&self, other: &Enum1)
|
fn partial_cmp(&self, other: &Enum1)
|
||||||
-> ::core::option::Option<::core::cmp::Ordering> {
|
-> ::core::option::Option<::core::cmp::Ordering> {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Enum1::Single { x: ref __self_0 }, &Enum1::Single {
|
(Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg_1_0 }) =>
|
||||||
x: ref __arg_1_0 }) =>
|
|
||||||
::core::cmp::PartialOrd::partial_cmp(&*__self_0, &*__arg_1_0),
|
::core::cmp::PartialOrd::partial_cmp(&*__self_0, &*__arg_1_0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -751,9 +750,8 @@ impl ::core::cmp::PartialOrd for Enum1 {
|
||||||
impl ::core::cmp::Ord for Enum1 {
|
impl ::core::cmp::Ord for Enum1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Enum1) -> ::core::cmp::Ordering {
|
fn cmp(&self, other: &Enum1) -> ::core::cmp::Ordering {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Enum1::Single { x: ref __self_0 }, &Enum1::Single {
|
(Enum1::Single { x: __self_0 }, Enum1::Single { x: __arg_1_0 }) =>
|
||||||
x: ref __arg_1_0 }) =>
|
|
||||||
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -770,15 +768,15 @@ enum Fieldless1 {
|
||||||
impl ::core::clone::Clone for Fieldless1 {
|
impl ::core::clone::Clone for Fieldless1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> Fieldless1 {
|
fn clone(&self) -> Fieldless1 {
|
||||||
match &*self { &Fieldless1::A => Fieldless1::A, }
|
match self { Fieldless1::A => Fieldless1::A, }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[automatically_derived]
|
#[automatically_derived]
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::fmt::Debug for Fieldless1 {
|
impl ::core::fmt::Debug for Fieldless1 {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||||
match &*self {
|
match self {
|
||||||
&Fieldless1::A => ::core::fmt::Formatter::write_str(f, "A"),
|
Fieldless1::A => ::core::fmt::Formatter::write_str(f, "A"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -792,7 +790,7 @@ impl ::core::default::Default for Fieldless1 {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::hash::Hash for Fieldless1 {
|
impl ::core::hash::Hash for Fieldless1 {
|
||||||
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
||||||
match &*self { _ => {} }
|
match self { _ => {} }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl ::core::marker::StructuralPartialEq for Fieldless1 {}
|
impl ::core::marker::StructuralPartialEq for Fieldless1 {}
|
||||||
|
@ -801,7 +799,7 @@ impl ::core::marker::StructuralPartialEq for Fieldless1 {}
|
||||||
impl ::core::cmp::PartialEq for Fieldless1 {
|
impl ::core::cmp::PartialEq for Fieldless1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &Fieldless1) -> bool {
|
fn eq(&self, other: &Fieldless1) -> bool {
|
||||||
match (&*self, &*other) { _ => true, }
|
match (self, other) { _ => true, }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
impl ::core::marker::StructuralEq for Fieldless1 {}
|
impl ::core::marker::StructuralEq for Fieldless1 {}
|
||||||
|
@ -819,7 +817,7 @@ impl ::core::cmp::PartialOrd for Fieldless1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn partial_cmp(&self, other: &Fieldless1)
|
fn partial_cmp(&self, other: &Fieldless1)
|
||||||
-> ::core::option::Option<::core::cmp::Ordering> {
|
-> ::core::option::Option<::core::cmp::Ordering> {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
_ => ::core::option::Option::Some(::core::cmp::Ordering::Equal),
|
_ => ::core::option::Option::Some(::core::cmp::Ordering::Equal),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -829,7 +827,7 @@ impl ::core::cmp::PartialOrd for Fieldless1 {
|
||||||
impl ::core::cmp::Ord for Fieldless1 {
|
impl ::core::cmp::Ord for Fieldless1 {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Fieldless1) -> ::core::cmp::Ordering {
|
fn cmp(&self, other: &Fieldless1) -> ::core::cmp::Ordering {
|
||||||
match (&*self, &*other) { _ => ::core::cmp::Ordering::Equal, }
|
match (self, other) { _ => ::core::cmp::Ordering::Equal, }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -854,10 +852,10 @@ impl ::core::marker::Copy for Fieldless { }
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::fmt::Debug for Fieldless {
|
impl ::core::fmt::Debug for Fieldless {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||||
match &*self {
|
match self {
|
||||||
&Fieldless::A => ::core::fmt::Formatter::write_str(f, "A"),
|
Fieldless::A => ::core::fmt::Formatter::write_str(f, "A"),
|
||||||
&Fieldless::B => ::core::fmt::Formatter::write_str(f, "B"),
|
Fieldless::B => ::core::fmt::Formatter::write_str(f, "B"),
|
||||||
&Fieldless::C => ::core::fmt::Formatter::write_str(f, "C"),
|
Fieldless::C => ::core::fmt::Formatter::write_str(f, "C"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -871,7 +869,7 @@ impl ::core::default::Default for Fieldless {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::hash::Hash for Fieldless {
|
impl ::core::hash::Hash for Fieldless {
|
||||||
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
||||||
match &*self {
|
match self {
|
||||||
_ => {
|
_ => {
|
||||||
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
||||||
state)
|
state)
|
||||||
|
@ -885,10 +883,10 @@ impl ::core::marker::StructuralPartialEq for Fieldless {}
|
||||||
impl ::core::cmp::PartialEq for Fieldless {
|
impl ::core::cmp::PartialEq for Fieldless {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &Fieldless) -> bool {
|
fn eq(&self, other: &Fieldless) -> bool {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) { _ => true, }
|
match (self, other) { _ => true, }
|
||||||
} else { false }
|
} else { false }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -907,10 +905,10 @@ impl ::core::cmp::PartialOrd for Fieldless {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn partial_cmp(&self, other: &Fieldless)
|
fn partial_cmp(&self, other: &Fieldless)
|
||||||
-> ::core::option::Option<::core::cmp::Ordering> {
|
-> ::core::option::Option<::core::cmp::Ordering> {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
_ =>
|
_ =>
|
||||||
::core::option::Option::Some(::core::cmp::Ordering::Equal),
|
::core::option::Option::Some(::core::cmp::Ordering::Equal),
|
||||||
}
|
}
|
||||||
|
@ -924,10 +922,10 @@ impl ::core::cmp::PartialOrd for Fieldless {
|
||||||
impl ::core::cmp::Ord for Fieldless {
|
impl ::core::cmp::Ord for Fieldless {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Fieldless) -> ::core::cmp::Ordering {
|
fn cmp(&self, other: &Fieldless) -> ::core::cmp::Ordering {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) { _ => ::core::cmp::Ordering::Equal, }
|
match (self, other) { _ => ::core::cmp::Ordering::Equal, }
|
||||||
} else { ::core::cmp::Ord::cmp(&__self_vi, &__arg_1_vi) }
|
} else { ::core::cmp::Ord::cmp(&__self_vi, &__arg_1_vi) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -960,13 +958,13 @@ impl ::core::marker::Copy for Mixed { }
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::fmt::Debug for Mixed {
|
impl ::core::fmt::Debug for Mixed {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||||
match &*self {
|
match self {
|
||||||
&Mixed::P => ::core::fmt::Formatter::write_str(f, "P"),
|
Mixed::P => ::core::fmt::Formatter::write_str(f, "P"),
|
||||||
&Mixed::Q => ::core::fmt::Formatter::write_str(f, "Q"),
|
Mixed::Q => ::core::fmt::Formatter::write_str(f, "Q"),
|
||||||
&Mixed::R(ref __self_0) =>
|
Mixed::R(__self_0) =>
|
||||||
::core::fmt::Formatter::debug_tuple_field1_finish(f, "R",
|
::core::fmt::Formatter::debug_tuple_field1_finish(f, "R",
|
||||||
&&*__self_0),
|
&&*__self_0),
|
||||||
&Mixed::S { d1: ref __self_0, d2: ref __self_1 } =>
|
Mixed::S { d1: __self_0, d2: __self_1 } =>
|
||||||
::core::fmt::Formatter::debug_struct_field2_finish(f, "S",
|
::core::fmt::Formatter::debug_struct_field2_finish(f, "S",
|
||||||
"d1", &&*__self_0, "d2", &&*__self_1),
|
"d1", &&*__self_0, "d2", &&*__self_1),
|
||||||
}
|
}
|
||||||
|
@ -982,13 +980,13 @@ impl ::core::default::Default for Mixed {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::hash::Hash for Mixed {
|
impl ::core::hash::Hash for Mixed {
|
||||||
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
||||||
match &*self {
|
match self {
|
||||||
&Mixed::R(ref __self_0) => {
|
Mixed::R(__self_0) => {
|
||||||
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
||||||
state);
|
state);
|
||||||
::core::hash::Hash::hash(&*__self_0, state)
|
::core::hash::Hash::hash(&*__self_0, state)
|
||||||
}
|
}
|
||||||
&Mixed::S { d1: ref __self_0, d2: ref __self_1 } => {
|
Mixed::S { d1: __self_0, d2: __self_1 } => {
|
||||||
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
||||||
state);
|
state);
|
||||||
::core::hash::Hash::hash(&*__self_0, state);
|
::core::hash::Hash::hash(&*__self_0, state);
|
||||||
|
@ -1007,14 +1005,14 @@ impl ::core::marker::StructuralPartialEq for Mixed {}
|
||||||
impl ::core::cmp::PartialEq for Mixed {
|
impl ::core::cmp::PartialEq for Mixed {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &Mixed) -> bool {
|
fn eq(&self, other: &Mixed) -> bool {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Mixed::R(ref __self_0), &Mixed::R(ref __arg_1_0)) =>
|
(Mixed::R(__self_0), Mixed::R(__arg_1_0)) =>
|
||||||
*__self_0 == *__arg_1_0,
|
*__self_0 == *__arg_1_0,
|
||||||
(&Mixed::S { d1: ref __self_0, d2: ref __self_1 },
|
(Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
|
||||||
&Mixed::S { d1: ref __arg_1_0, d2: ref __arg_1_1 }) =>
|
d1: __arg_1_0, d2: __arg_1_1 }) =>
|
||||||
*__self_0 == *__arg_1_0 && *__self_1 == *__arg_1_1,
|
*__self_0 == *__arg_1_0 && *__self_1 == *__arg_1_1,
|
||||||
_ => true,
|
_ => true,
|
||||||
}
|
}
|
||||||
|
@ -1022,14 +1020,14 @@ impl ::core::cmp::PartialEq for Mixed {
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn ne(&self, other: &Mixed) -> bool {
|
fn ne(&self, other: &Mixed) -> bool {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Mixed::R(ref __self_0), &Mixed::R(ref __arg_1_0)) =>
|
(Mixed::R(__self_0), Mixed::R(__arg_1_0)) =>
|
||||||
*__self_0 != *__arg_1_0,
|
*__self_0 != *__arg_1_0,
|
||||||
(&Mixed::S { d1: ref __self_0, d2: ref __self_1 },
|
(Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
|
||||||
&Mixed::S { d1: ref __arg_1_0, d2: ref __arg_1_1 }) =>
|
d1: __arg_1_0, d2: __arg_1_1 }) =>
|
||||||
*__self_0 != *__arg_1_0 || *__self_1 != *__arg_1_1,
|
*__self_0 != *__arg_1_0 || *__self_1 != *__arg_1_1,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
@ -1053,15 +1051,15 @@ impl ::core::cmp::PartialOrd for Mixed {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn partial_cmp(&self, other: &Mixed)
|
fn partial_cmp(&self, other: &Mixed)
|
||||||
-> ::core::option::Option<::core::cmp::Ordering> {
|
-> ::core::option::Option<::core::cmp::Ordering> {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Mixed::R(ref __self_0), &Mixed::R(ref __arg_1_0)) =>
|
(Mixed::R(__self_0), Mixed::R(__arg_1_0)) =>
|
||||||
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
||||||
&*__arg_1_0),
|
&*__arg_1_0),
|
||||||
(&Mixed::S { d1: ref __self_0, d2: ref __self_1 },
|
(Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
|
||||||
&Mixed::S { d1: ref __arg_1_0, d2: ref __arg_1_1 }) =>
|
d1: __arg_1_0, d2: __arg_1_1 }) =>
|
||||||
match ::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
match ::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
||||||
&*__arg_1_0) {
|
&*__arg_1_0) {
|
||||||
::core::option::Option::Some(::core::cmp::Ordering::Equal)
|
::core::option::Option::Some(::core::cmp::Ordering::Equal)
|
||||||
|
@ -1083,14 +1081,14 @@ impl ::core::cmp::PartialOrd for Mixed {
|
||||||
impl ::core::cmp::Ord for Mixed {
|
impl ::core::cmp::Ord for Mixed {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Mixed) -> ::core::cmp::Ordering {
|
fn cmp(&self, other: &Mixed) -> ::core::cmp::Ordering {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Mixed::R(ref __self_0), &Mixed::R(ref __arg_1_0)) =>
|
(Mixed::R(__self_0), Mixed::R(__arg_1_0)) =>
|
||||||
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
||||||
(&Mixed::S { d1: ref __self_0, d2: ref __self_1 },
|
(Mixed::S { d1: __self_0, d2: __self_1 }, Mixed::S {
|
||||||
&Mixed::S { d1: ref __arg_1_0, d2: ref __arg_1_1 }) =>
|
d1: __arg_1_0, d2: __arg_1_1 }) =>
|
||||||
match ::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0) {
|
match ::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0) {
|
||||||
::core::cmp::Ordering::Equal =>
|
::core::cmp::Ordering::Equal =>
|
||||||
::core::cmp::Ord::cmp(&*__self_1, &*__arg_1_1),
|
::core::cmp::Ord::cmp(&*__self_1, &*__arg_1_1),
|
||||||
|
@ -1110,12 +1108,12 @@ enum Fielded { X(u32), Y(bool), Z(Option<i32>), }
|
||||||
impl ::core::clone::Clone for Fielded {
|
impl ::core::clone::Clone for Fielded {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn clone(&self) -> Fielded {
|
fn clone(&self) -> Fielded {
|
||||||
match &*self {
|
match self {
|
||||||
&Fielded::X(ref __self_0) =>
|
Fielded::X(__self_0) =>
|
||||||
Fielded::X(::core::clone::Clone::clone(&*__self_0)),
|
Fielded::X(::core::clone::Clone::clone(&*__self_0)),
|
||||||
&Fielded::Y(ref __self_0) =>
|
Fielded::Y(__self_0) =>
|
||||||
Fielded::Y(::core::clone::Clone::clone(&*__self_0)),
|
Fielded::Y(::core::clone::Clone::clone(&*__self_0)),
|
||||||
&Fielded::Z(ref __self_0) =>
|
Fielded::Z(__self_0) =>
|
||||||
Fielded::Z(::core::clone::Clone::clone(&*__self_0)),
|
Fielded::Z(::core::clone::Clone::clone(&*__self_0)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1124,14 +1122,14 @@ impl ::core::clone::Clone for Fielded {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::fmt::Debug for Fielded {
|
impl ::core::fmt::Debug for Fielded {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||||
match &*self {
|
match self {
|
||||||
&Fielded::X(ref __self_0) =>
|
Fielded::X(__self_0) =>
|
||||||
::core::fmt::Formatter::debug_tuple_field1_finish(f, "X",
|
::core::fmt::Formatter::debug_tuple_field1_finish(f, "X",
|
||||||
&&*__self_0),
|
&&*__self_0),
|
||||||
&Fielded::Y(ref __self_0) =>
|
Fielded::Y(__self_0) =>
|
||||||
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Y",
|
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Y",
|
||||||
&&*__self_0),
|
&&*__self_0),
|
||||||
&Fielded::Z(ref __self_0) =>
|
Fielded::Z(__self_0) =>
|
||||||
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Z",
|
::core::fmt::Formatter::debug_tuple_field1_finish(f, "Z",
|
||||||
&&*__self_0),
|
&&*__self_0),
|
||||||
}
|
}
|
||||||
|
@ -1141,18 +1139,18 @@ impl ::core::fmt::Debug for Fielded {
|
||||||
#[allow(unused_qualifications)]
|
#[allow(unused_qualifications)]
|
||||||
impl ::core::hash::Hash for Fielded {
|
impl ::core::hash::Hash for Fielded {
|
||||||
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
|
||||||
match &*self {
|
match self {
|
||||||
&Fielded::X(ref __self_0) => {
|
Fielded::X(__self_0) => {
|
||||||
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
||||||
state);
|
state);
|
||||||
::core::hash::Hash::hash(&*__self_0, state)
|
::core::hash::Hash::hash(&*__self_0, state)
|
||||||
}
|
}
|
||||||
&Fielded::Y(ref __self_0) => {
|
Fielded::Y(__self_0) => {
|
||||||
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
||||||
state);
|
state);
|
||||||
::core::hash::Hash::hash(&*__self_0, state)
|
::core::hash::Hash::hash(&*__self_0, state)
|
||||||
}
|
}
|
||||||
&Fielded::Z(ref __self_0) => {
|
Fielded::Z(__self_0) => {
|
||||||
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
::core::hash::Hash::hash(&::core::intrinsics::discriminant_value(self),
|
||||||
state);
|
state);
|
||||||
::core::hash::Hash::hash(&*__self_0, state)
|
::core::hash::Hash::hash(&*__self_0, state)
|
||||||
|
@ -1166,15 +1164,15 @@ impl ::core::marker::StructuralPartialEq for Fielded {}
|
||||||
impl ::core::cmp::PartialEq for Fielded {
|
impl ::core::cmp::PartialEq for Fielded {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn eq(&self, other: &Fielded) -> bool {
|
fn eq(&self, other: &Fielded) -> bool {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Fielded::X(ref __self_0), &Fielded::X(ref __arg_1_0)) =>
|
(Fielded::X(__self_0), Fielded::X(__arg_1_0)) =>
|
||||||
*__self_0 == *__arg_1_0,
|
*__self_0 == *__arg_1_0,
|
||||||
(&Fielded::Y(ref __self_0), &Fielded::Y(ref __arg_1_0)) =>
|
(Fielded::Y(__self_0), Fielded::Y(__arg_1_0)) =>
|
||||||
*__self_0 == *__arg_1_0,
|
*__self_0 == *__arg_1_0,
|
||||||
(&Fielded::Z(ref __self_0), &Fielded::Z(ref __arg_1_0)) =>
|
(Fielded::Z(__self_0), Fielded::Z(__arg_1_0)) =>
|
||||||
*__self_0 == *__arg_1_0,
|
*__self_0 == *__arg_1_0,
|
||||||
_ => unsafe { ::core::intrinsics::unreachable() }
|
_ => unsafe { ::core::intrinsics::unreachable() }
|
||||||
}
|
}
|
||||||
|
@ -1182,15 +1180,15 @@ impl ::core::cmp::PartialEq for Fielded {
|
||||||
}
|
}
|
||||||
#[inline]
|
#[inline]
|
||||||
fn ne(&self, other: &Fielded) -> bool {
|
fn ne(&self, other: &Fielded) -> bool {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Fielded::X(ref __self_0), &Fielded::X(ref __arg_1_0)) =>
|
(Fielded::X(__self_0), Fielded::X(__arg_1_0)) =>
|
||||||
*__self_0 != *__arg_1_0,
|
*__self_0 != *__arg_1_0,
|
||||||
(&Fielded::Y(ref __self_0), &Fielded::Y(ref __arg_1_0)) =>
|
(Fielded::Y(__self_0), Fielded::Y(__arg_1_0)) =>
|
||||||
*__self_0 != *__arg_1_0,
|
*__self_0 != *__arg_1_0,
|
||||||
(&Fielded::Z(ref __self_0), &Fielded::Z(ref __arg_1_0)) =>
|
(Fielded::Z(__self_0), Fielded::Z(__arg_1_0)) =>
|
||||||
*__self_0 != *__arg_1_0,
|
*__self_0 != *__arg_1_0,
|
||||||
_ => unsafe { ::core::intrinsics::unreachable() }
|
_ => unsafe { ::core::intrinsics::unreachable() }
|
||||||
}
|
}
|
||||||
|
@ -1216,17 +1214,17 @@ impl ::core::cmp::PartialOrd for Fielded {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn partial_cmp(&self, other: &Fielded)
|
fn partial_cmp(&self, other: &Fielded)
|
||||||
-> ::core::option::Option<::core::cmp::Ordering> {
|
-> ::core::option::Option<::core::cmp::Ordering> {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Fielded::X(ref __self_0), &Fielded::X(ref __arg_1_0)) =>
|
(Fielded::X(__self_0), Fielded::X(__arg_1_0)) =>
|
||||||
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
||||||
&*__arg_1_0),
|
&*__arg_1_0),
|
||||||
(&Fielded::Y(ref __self_0), &Fielded::Y(ref __arg_1_0)) =>
|
(Fielded::Y(__self_0), Fielded::Y(__arg_1_0)) =>
|
||||||
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
||||||
&*__arg_1_0),
|
&*__arg_1_0),
|
||||||
(&Fielded::Z(ref __self_0), &Fielded::Z(ref __arg_1_0)) =>
|
(Fielded::Z(__self_0), Fielded::Z(__arg_1_0)) =>
|
||||||
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
::core::cmp::PartialOrd::partial_cmp(&*__self_0,
|
||||||
&*__arg_1_0),
|
&*__arg_1_0),
|
||||||
_ => unsafe { ::core::intrinsics::unreachable() }
|
_ => unsafe { ::core::intrinsics::unreachable() }
|
||||||
|
@ -1241,15 +1239,15 @@ impl ::core::cmp::PartialOrd for Fielded {
|
||||||
impl ::core::cmp::Ord for Fielded {
|
impl ::core::cmp::Ord for Fielded {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn cmp(&self, other: &Fielded) -> ::core::cmp::Ordering {
|
fn cmp(&self, other: &Fielded) -> ::core::cmp::Ordering {
|
||||||
let __self_vi = ::core::intrinsics::discriminant_value(&*self);
|
let __self_vi = ::core::intrinsics::discriminant_value(self);
|
||||||
let __arg_1_vi = ::core::intrinsics::discriminant_value(&*other);
|
let __arg_1_vi = ::core::intrinsics::discriminant_value(other);
|
||||||
if __self_vi == __arg_1_vi {
|
if __self_vi == __arg_1_vi {
|
||||||
match (&*self, &*other) {
|
match (self, other) {
|
||||||
(&Fielded::X(ref __self_0), &Fielded::X(ref __arg_1_0)) =>
|
(Fielded::X(__self_0), Fielded::X(__arg_1_0)) =>
|
||||||
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
||||||
(&Fielded::Y(ref __self_0), &Fielded::Y(ref __arg_1_0)) =>
|
(Fielded::Y(__self_0), Fielded::Y(__arg_1_0)) =>
|
||||||
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
||||||
(&Fielded::Z(ref __self_0), &Fielded::Z(ref __arg_1_0)) =>
|
(Fielded::Z(__self_0), Fielded::Z(__arg_1_0)) =>
|
||||||
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
::core::cmp::Ord::cmp(&*__self_0, &*__arg_1_0),
|
||||||
_ => unsafe { ::core::intrinsics::unreachable() }
|
_ => unsafe { ::core::intrinsics::unreachable() }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue