diff options
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/back/link.rs | 1 | ||||
| -rw-r--r-- | src/rustc/driver/driver.rs | 1 | ||||
| -rw-r--r-- | src/rustc/driver/rustc.rs | 1 | ||||
| -rw-r--r-- | src/rustc/driver/session.rs | 3 | ||||
| -rw-r--r-- | src/rustc/lib/llvm.rs | 1 | ||||
| -rw-r--r-- | src/rustc/metadata/decoder.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/borrowck.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/borrowck/check_loans.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/check_alt.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/const_eval.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/lint.rs | 2 | ||||
| -rw-r--r-- | src/rustc/middle/liveness.rs | 11 | ||||
| -rw-r--r-- | src/rustc/middle/mem_categorization.rs | 6 | ||||
| -rw-r--r-- | src/rustc/middle/region.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/resolve.rs | 6 | ||||
| -rw-r--r-- | src/rustc/middle/trans/alt.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/trans/common.rs | 3 | ||||
| -rw-r--r-- | src/rustc/middle/trans/datum.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/trans/expr.rs | 4 | ||||
| -rw-r--r-- | src/rustc/middle/trans/foreign.rs | 1 | ||||
| -rw-r--r-- | src/rustc/middle/ty.rs | 45 | ||||
| -rw-r--r-- | src/rustc/middle/typeck/infer/region_var_bindings.rs | 4 |
22 files changed, 76 insertions, 22 deletions
diff --git a/src/rustc/back/link.rs b/src/rustc/back/link.rs index e6380fd1be6..afd94e4f437 100644 --- a/src/rustc/back/link.rs +++ b/src/rustc/back/link.rs @@ -30,6 +30,7 @@ impl output_type : cmp::Eq { pure fn eq(&&other: output_type) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: output_type) -> bool { !self.eq(other) } } fn llvm_err(sess: session, msg: ~str) -> ! unsafe { diff --git a/src/rustc/driver/driver.rs b/src/rustc/driver/driver.rs index 024452302da..ecdd02b4697 100644 --- a/src/rustc/driver/driver.rs +++ b/src/rustc/driver/driver.rs @@ -140,6 +140,7 @@ impl compile_upto : cmp::Eq { pure fn eq(&&other: compile_upto) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: compile_upto) -> bool { !self.eq(other) } } fn compile_upto(sess: session, cfg: ast::crate_cfg, diff --git a/src/rustc/driver/rustc.rs b/src/rustc/driver/rustc.rs index 8b8325853cc..3c0e4d0f9e1 100644 --- a/src/rustc/driver/rustc.rs +++ b/src/rustc/driver/rustc.rs @@ -209,6 +209,7 @@ impl monitor_msg : cmp::Eq { pure fn eq(&&other: monitor_msg) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: monitor_msg) -> bool { !self.eq(other) } } /* diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs index 290c6e94654..66544d72db5 100644 --- a/src/rustc/driver/session.rs +++ b/src/rustc/driver/session.rs @@ -16,6 +16,7 @@ impl os : cmp::Eq { pure fn eq(&&other: os) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: os) -> bool { !self.eq(other) } } enum arch { arch_x86, arch_x86_64, arch_arm, } @@ -24,6 +25,7 @@ impl arch: cmp::Eq { pure fn eq(&&other: arch) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: arch) -> bool { !self.eq(other) } } enum crate_type { bin_crate, lib_crate, unknown_crate, } @@ -95,6 +97,7 @@ impl OptLevel : cmp::Eq { pure fn eq(&&other: OptLevel) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: OptLevel) -> bool { !self.eq(other) } } type options = diff --git a/src/rustc/lib/llvm.rs b/src/rustc/lib/llvm.rs index 23566e59cf9..a6d82e14ea5 100644 --- a/src/rustc/lib/llvm.rs +++ b/src/rustc/lib/llvm.rs @@ -165,6 +165,7 @@ impl TypeKind : cmp::Eq { (X86_MMX, _) => false, } } + pure fn ne(&&other: TypeKind) -> bool { !self.eq(other) } } enum AtomicBinOp { diff --git a/src/rustc/metadata/decoder.rs b/src/rustc/metadata/decoder.rs index b738295d262..1ea6f2bcd61 100644 --- a/src/rustc/metadata/decoder.rs +++ b/src/rustc/metadata/decoder.rs @@ -133,6 +133,7 @@ impl Family : cmp::Eq { pure fn eq(&&other: Family) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: Family) -> bool { !self.eq(other) } } fn item_family(item: ebml::Doc) -> Family { diff --git a/src/rustc/middle/borrowck.rs b/src/rustc/middle/borrowck.rs index 176e133529c..785665b42bf 100644 --- a/src/rustc/middle/borrowck.rs +++ b/src/rustc/middle/borrowck.rs @@ -365,6 +365,7 @@ impl bckerr_code : cmp::Eq { } } } + pure fn ne(&&other: bckerr_code) -> bool { !self.eq(other) } } // Combination of an error code and the categorization of the expression @@ -375,6 +376,7 @@ impl bckerr : cmp::Eq { pure fn eq(&&other: bckerr) -> bool { self.cmt == other.cmt && self.code == other.code } + pure fn ne(&&other: bckerr) -> bool { !self.eq(other) } } // shorthand for something that fails with `bckerr` or succeeds with `T` diff --git a/src/rustc/middle/borrowck/check_loans.rs b/src/rustc/middle/borrowck/check_loans.rs index a81620b20ba..0a13ee2ae1e 100644 --- a/src/rustc/middle/borrowck/check_loans.rs +++ b/src/rustc/middle/borrowck/check_loans.rs @@ -53,6 +53,7 @@ impl purity_cause : cmp::Eq { } } } + pure fn ne(&&other: purity_cause) -> bool { !self.eq(other) } } fn check_loans(bccx: borrowck_ctxt, diff --git a/src/rustc/middle/check_alt.rs b/src/rustc/middle/check_alt.rs index f56833c1dbc..364cd4890ab 100644 --- a/src/rustc/middle/check_alt.rs +++ b/src/rustc/middle/check_alt.rs @@ -138,6 +138,7 @@ impl ctor: cmp::Eq { } } } + pure fn ne(&&other: ctor) -> bool { !self.eq(other) } } // Algorithm from http://moscova.inria.fr/~maranget/papers/warn/index.html diff --git a/src/rustc/middle/const_eval.rs b/src/rustc/middle/const_eval.rs index a06403af2e0..beceec4cfd3 100644 --- a/src/rustc/middle/const_eval.rs +++ b/src/rustc/middle/const_eval.rs @@ -201,6 +201,7 @@ impl const_val: cmp::Eq { (const_str(_), _) | (const_bool(_), _) => false } } + pure fn ne(&&other: const_val) -> bool { !self.eq(other) } } // FIXME: issue #1417 diff --git a/src/rustc/middle/lint.rs b/src/rustc/middle/lint.rs index 8c2776d3ceb..51210870b41 100644 --- a/src/rustc/middle/lint.rs +++ b/src/rustc/middle/lint.rs @@ -68,6 +68,7 @@ impl lint : cmp::Eq { pure fn eq(&&other: lint) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: lint) -> bool { !self.eq(other) } } fn level_to_str(lv: level) -> ~str { @@ -87,6 +88,7 @@ impl level : cmp::Eq { pure fn eq(&&other: level) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: level) -> bool { !self.eq(other) } } type lint_spec = @{lint: lint, diff --git a/src/rustc/middle/liveness.rs b/src/rustc/middle/liveness.rs index f3459aa8cb3..ed7f793197d 100644 --- a/src/rustc/middle/liveness.rs +++ b/src/rustc/middle/liveness.rs @@ -128,15 +128,13 @@ enum Variable = uint; enum LiveNode = uint; impl Variable : cmp::Eq { - pure fn eq(&&other: Variable) -> bool { - *self == *other - } + pure fn eq(&&other: Variable) -> bool { *self == *other } + pure fn ne(&&other: Variable) -> bool { *self != *other } } impl LiveNode : cmp::Eq { - pure fn eq(&&other: LiveNode) -> bool { - *self == *other - } + pure fn eq(&&other: LiveNode) -> bool { *self == *other } + pure fn ne(&&other: LiveNode) -> bool { *self != *other } } enum LiveNodeKind { @@ -175,6 +173,7 @@ impl LiveNodeKind : cmp::Eq { } } } + pure fn ne(&&other: LiveNodeKind) -> bool { !self.eq(other) } } fn check_crate(tcx: ty::ctxt, diff --git a/src/rustc/middle/mem_categorization.rs b/src/rustc/middle/mem_categorization.rs index 99d0e6372e0..77e234770e6 100644 --- a/src/rustc/middle/mem_categorization.rs +++ b/src/rustc/middle/mem_categorization.rs @@ -115,6 +115,7 @@ impl categorization : cmp::Eq { } } } + pure fn ne(&&other: categorization) -> bool { !self.eq(other) } } // different kinds of pointers: @@ -154,6 +155,7 @@ impl ptr_kind : cmp::Eq { } } } + pure fn ne(&&other: ptr_kind) -> bool { !self.eq(other) } } // I am coining the term "components" to mean "pieces of a data @@ -196,6 +198,7 @@ impl comp_kind : cmp::Eq { } } } + pure fn ne(&&other: comp_kind) -> bool { !self.eq(other) } } // different kinds of expressions we might evaluate @@ -210,6 +213,7 @@ impl special_kind : cmp::Eq { pure fn eq(&&other: special_kind) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: special_kind) -> bool { !self.eq(other) } } // a complete categorization of a value indicating where it originated @@ -233,6 +237,7 @@ impl cmt_ : cmp::Eq { self.mutbl == other.mutbl && self.ty == other.ty } + pure fn ne(&&other: cmt_) -> bool { !self.eq(other) } } // a loan path is like a category, but it exists only when the data is @@ -274,6 +279,7 @@ impl loan_path : cmp::Eq { } } } + pure fn ne(&&other: loan_path) -> bool { !self.eq(other) } } // We pun on *T to mean both actual deref of a ptr as well diff --git a/src/rustc/middle/region.rs b/src/rustc/middle/region.rs index 579c096e634..514a816a63a 100644 --- a/src/rustc/middle/region.rs +++ b/src/rustc/middle/region.rs @@ -378,6 +378,7 @@ impl region_dep: cmp::Eq { pure fn eq(&&other: region_dep) -> bool { self.ambient_variance == other.ambient_variance && self.id == other.id } + pure fn ne(&&other: region_dep) -> bool { !self.eq(other) } } type determine_rp_ctxt_ = { diff --git a/src/rustc/middle/resolve.rs b/src/rustc/middle/resolve.rs index 1168260b519..4bea8e7c508 100644 --- a/src/rustc/middle/resolve.rs +++ b/src/rustc/middle/resolve.rs @@ -114,6 +114,7 @@ impl PatternBindingMode : cmp::Eq { pure fn eq(&&other: PatternBindingMode) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: PatternBindingMode) -> bool { !self.eq(other) } } @@ -154,6 +155,7 @@ impl Mutability : cmp::Eq { pure fn eq(&&other: Mutability) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: Mutability) -> bool { !self.eq(other) } } enum SelfBinding { @@ -188,6 +190,7 @@ impl ImportDirectiveNS : cmp::Eq { pure fn eq(&&other: ImportDirectiveNS) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: ImportDirectiveNS) -> bool { !self.eq(other) } } /// Contains data for specific types of import directives. @@ -274,6 +277,7 @@ impl XrayFlag : cmp::Eq { pure fn eq(&&other: XrayFlag) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: XrayFlag) -> bool { !self.eq(other) } } enum AllowCapturingSelfFlag { @@ -285,6 +289,7 @@ impl AllowCapturingSelfFlag : cmp::Eq { pure fn eq(&&other: AllowCapturingSelfFlag) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: AllowCapturingSelfFlag) -> bool { !self.eq(other) } } enum EnumVariantOrConstResolution { @@ -483,6 +488,7 @@ impl Privacy : cmp::Eq { pure fn eq(&&other: Privacy) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: Privacy) -> bool { !self.eq(other) } } // Records a possibly-private definition. diff --git a/src/rustc/middle/trans/alt.rs b/src/rustc/middle/trans/alt.rs index 643e385cd17..6884bc48d62 100644 --- a/src/rustc/middle/trans/alt.rs +++ b/src/rustc/middle/trans/alt.rs @@ -424,6 +424,7 @@ impl branch_kind : cmp::Eq { pure fn eq(&&other: branch_kind) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: branch_kind) -> bool { !self.eq(other) } } fn compile_submatch(bcx: block, m: match_, vals: ~[ValueRef], diff --git a/src/rustc/middle/trans/common.rs b/src/rustc/middle/trans/common.rs index 7e612051565..9445efe41fa 100644 --- a/src/rustc/middle/trans/common.rs +++ b/src/rustc/middle/trans/common.rs @@ -288,6 +288,7 @@ impl cleantype : cmp::Eq { } } } + pure fn ne(&&other: cleantype) -> bool { !self.eq(other) } } // Used to remember and reuse existing cleanup paths @@ -1114,12 +1115,14 @@ impl mono_param_id: cmp::Eq { (mono_repr(*), _) => false } } + pure fn ne(&&other: mono_param_id) -> bool { !self.eq(other) } } impl mono_id_: cmp::Eq { pure fn eq(&&other: mono_id_) -> bool { return self.def == other.def && self.params == other.params; } + pure fn ne(&&other: mono_id_) -> bool { !self.eq(other) } } pure fn hash_mono_id(mi: &mono_id) -> uint { diff --git a/src/rustc/middle/trans/datum.rs b/src/rustc/middle/trans/datum.rs index 539439ecc81..f2525ce90b0 100644 --- a/src/rustc/middle/trans/datum.rs +++ b/src/rustc/middle/trans/datum.rs @@ -748,4 +748,5 @@ impl CopyAction : cmp::Eq { (DROP_EXISTING, _) => false, } } + pure fn ne(&&other: CopyAction) -> bool { !self.eq(other) } } diff --git a/src/rustc/middle/trans/expr.rs b/src/rustc/middle/trans/expr.rs index 118eff8c53b..b1ee870dbb5 100644 --- a/src/rustc/middle/trans/expr.rs +++ b/src/rustc/middle/trans/expr.rs @@ -157,6 +157,7 @@ impl Dest : cmp::Eq { (Ignore, _) => false, } } + pure fn ne(&&other: Dest) -> bool { !self.eq(other) } } fn trans_to_appropriate_llval(bcx: block, @@ -1265,6 +1266,7 @@ impl cast_kind : cmp::Eq { (cast_other, _) => false, } } + pure fn ne(&&other: cast_kind) -> bool { !self.eq(other) } } fn cast_type_kind(t: ty::t) -> cast_kind { @@ -1381,4 +1383,4 @@ fn trans_assign_op(bcx: block, fn shorten(+x: ~str) -> ~str { if x.len() > 60 { x.substr(0, 60) } else { x } -} \ No newline at end of file +} diff --git a/src/rustc/middle/trans/foreign.rs b/src/rustc/middle/trans/foreign.rs index bb5ea98e1b4..c5cb5ee300b 100644 --- a/src/rustc/middle/trans/foreign.rs +++ b/src/rustc/middle/trans/foreign.rs @@ -44,6 +44,7 @@ impl x86_64_reg_class: cmp::Eq { pure fn eq(&&other: x86_64_reg_class) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: x86_64_reg_class) -> bool { !self.eq(other) } } fn is_sse(++c: x86_64_reg_class) -> bool { diff --git a/src/rustc/middle/ty.rs b/src/rustc/middle/ty.rs index dd48c2183a7..fa2f021c9b2 100644 --- a/src/rustc/middle/ty.rs +++ b/src/rustc/middle/ty.rs @@ -234,6 +234,7 @@ impl intern_key: cmp::Eq { pure fn eq(&&other: intern_key) -> bool { self.struct == other.struct && self.o_def_id == other.o_def_id } + pure fn ne(&&other: intern_key) -> bool { !self.eq(other) } } enum ast_ty_to_ty_cache_entry { @@ -258,6 +259,7 @@ impl region_variance: cmp::Eq { (rv_contravariant, _) => false } } + pure fn ne(&&other: region_variance) -> bool { !self.eq(other) } } // N.B.: Borrows from inlined content are not accurately deserialized. This @@ -272,6 +274,7 @@ impl borrow : cmp::Eq { pure fn eq(&&other: borrow) -> bool { self.region == other.region && self.mutbl == other.mutbl } + pure fn ne(&&other: borrow) -> bool { !self.eq(other) } } type ctxt = @@ -367,6 +370,7 @@ impl closure_kind : cmp::Eq { pure fn eq(&&other: closure_kind) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: closure_kind) -> bool { !self.eq(other) } } enum fn_proto { @@ -391,6 +395,7 @@ impl fn_proto : cmp::Eq { } } } + pure fn ne(&&other: fn_proto) -> bool { !self.eq(other) } } /** @@ -436,6 +441,7 @@ impl param_ty: cmp::Eq { pure fn eq(&&other: param_ty) -> bool { self.idx == other.idx && self.def_id == other.def_id } + pure fn ne(&&other: param_ty) -> bool { !self.eq(other) } } /// Representation of regions: @@ -3709,18 +3715,21 @@ impl mt : cmp::Eq { pure fn eq(&&other: mt) -> bool { self.ty == other.ty && self.mutbl == other.mutbl } + pure fn ne(&&other: mt) -> bool { !self.eq(other) } } impl arg : cmp::Eq { pure fn eq(&&other: arg) -> bool { self.mode == other.mode && self.ty == other.ty } + pure fn ne(&&other: arg) -> bool { !self.eq(other) } } impl field : cmp::Eq { pure fn eq(&&other: field) -> bool { self.ident == other.ident && self.mt == other.mt } + pure fn ne(&&other: field) -> bool { !self.eq(other) } } impl vstore : cmp::Eq { @@ -3752,6 +3761,7 @@ impl vstore : cmp::Eq { } } } + pure fn ne(&&other: vstore) -> bool { !self.eq(other) } } impl FnMeta : cmp::Eq { @@ -3761,6 +3771,7 @@ impl FnMeta : cmp::Eq { self.bounds == other.bounds && self.ret_style == other.ret_style } + pure fn ne(&&other: FnMeta) -> bool { !self.eq(other) } } impl FnSig : cmp::Eq { @@ -3768,36 +3779,35 @@ impl FnSig : cmp::Eq { self.inputs == other.inputs && self.output == other.output } + pure fn ne(&&other: FnSig) -> bool { !self.eq(other) } + } impl<M: cmp::Eq> FnTyBase<M> : cmp::Eq { pure fn eq(&&other: FnTyBase<M>) -> bool { self.meta == other.meta && self.sig == other.sig } + pure fn ne(&&other: FnTyBase<M>) -> bool { !self.eq(other) } } impl TyVid: cmp::Eq { - pure fn eq(&&other: TyVid) -> bool { - *self == *other - } + pure fn eq(&&other: TyVid) -> bool { *self == *other } + pure fn ne(&&other: TyVid) -> bool { *self != *other } } impl IntVid: cmp::Eq { - pure fn eq(&&other: IntVid) -> bool { - *self == *other - } + pure fn eq(&&other: IntVid) -> bool { *self == *other } + pure fn ne(&&other: IntVid) -> bool { *self != *other } } impl FnVid: cmp::Eq { - pure fn eq(&&other: FnVid) -> bool { - *self == *other - } + pure fn eq(&&other: FnVid) -> bool { *self == *other } + pure fn ne(&&other: FnVid) -> bool { *self != *other } } impl RegionVid: cmp::Eq { - pure fn eq(&&other: RegionVid) -> bool { - *self == *other - } + pure fn eq(&&other: RegionVid) -> bool { *self == *other } + pure fn ne(&&other: RegionVid) -> bool { *self != *other } } impl region : cmp::Eq { @@ -3835,6 +3845,7 @@ impl region : cmp::Eq { } } } + pure fn ne(&&other: region) -> bool { !self.eq(other) } } impl bound_region : cmp::Eq { @@ -3866,6 +3877,7 @@ impl bound_region : cmp::Eq { } } } + pure fn ne(&&other: bound_region) -> bool { !self.eq(other) } } impl substs : cmp::Eq { @@ -3874,12 +3886,14 @@ impl substs : cmp::Eq { self.self_ty == other.self_ty && self.tps == other.tps } + pure fn ne(&&other: substs) -> bool { !self.eq(other) } } impl InferTy : cmp::Eq { pure fn eq(&&other: InferTy) -> bool { self.to_hash() == other.to_hash() } + pure fn ne(&&other: InferTy) -> bool { !self.eq(other) } } impl sty : cmp::Eq { @@ -4038,6 +4052,7 @@ impl sty : cmp::Eq { } } } + pure fn ne(&&other: sty) -> bool { !self.eq(other) } } impl param_bound : cmp::Eq { @@ -4075,12 +4090,12 @@ impl param_bound : cmp::Eq { } } } + pure fn ne(&&other: param_bound) -> bool { !self.eq(other) } } impl kind : cmp::Eq { - pure fn eq(&&other: kind) -> bool { - *self == *other - } + pure fn eq(&&other: kind) -> bool { *self == *other } + pure fn ne(&&other: kind) -> bool { *self != *other } } diff --git a/src/rustc/middle/typeck/infer/region_var_bindings.rs b/src/rustc/middle/typeck/infer/region_var_bindings.rs index b34ffef811a..96d0cf9c110 100644 --- a/src/rustc/middle/typeck/infer/region_var_bindings.rs +++ b/src/rustc/middle/typeck/infer/region_var_bindings.rs @@ -346,6 +346,7 @@ impl Constraint: cmp::Eq { (ConstrainVarSubReg(*), _) => false } } + pure fn ne(&&other: Constraint) -> bool { !self.eq(other) } } struct TwoRegions { @@ -357,6 +358,7 @@ impl TwoRegions: cmp::Eq { pure fn eq(&&other: TwoRegions) -> bool { self.a == other.a && self.b == other.b } + pure fn ne(&&other: TwoRegions) -> bool { !self.eq(other) } } enum UndoLogEntry { @@ -753,6 +755,7 @@ impl Direction : cmp::Eq { pure fn eq(&&other: Direction) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: Direction) -> bool { !self.eq(other) } } enum Classification { Expanding, Contracting } @@ -761,6 +764,7 @@ impl Classification : cmp::Eq { pure fn eq(&&other: Classification) -> bool { (self as uint) == (other as uint) } + pure fn ne(&&other: Classification) -> bool { !self.eq(other) } } enum GraphNodeValue { NoValue, Value(region), ErrorValue } |
