Skip to content

Commit eb71976

Browse files
author
Jorge Aparicio
committed
librustc: convert TypeContents binops to by value
1 parent c4fa2a3 commit eb71976

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/librustc/middle/ty.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,24 +2859,51 @@ impl TypeContents {
28592859
}
28602860
}
28612861

2862+
// NOTE(stage0): Remove impl after a snapshot
2863+
#[cfg(stage0)]
28622864
impl ops::BitOr<TypeContents,TypeContents> for TypeContents {
28632865
fn bitor(&self, other: &TypeContents) -> TypeContents {
28642866
TypeContents {bits: self.bits | other.bits}
28652867
}
28662868
}
28672869

2870+
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
2871+
impl ops::BitOr<TypeContents,TypeContents> for TypeContents {
2872+
fn bitor(self, other: TypeContents) -> TypeContents {
2873+
TypeContents {bits: self.bits | other.bits}
2874+
}
2875+
}
2876+
2877+
// NOTE(stage0): Remove impl after a snapshot
2878+
#[cfg(stage0)]
28682879
impl ops::BitAnd<TypeContents,TypeContents> for TypeContents {
28692880
fn bitand(&self, other: &TypeContents) -> TypeContents {
28702881
TypeContents {bits: self.bits & other.bits}
28712882
}
28722883
}
28732884

2885+
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
2886+
impl ops::BitAnd<TypeContents, TypeContents> for TypeContents {
2887+
fn bitand(self, other: TypeContents) -> TypeContents {
2888+
TypeContents {bits: self.bits & other.bits}
2889+
}
2890+
}
2891+
2892+
// NOTE(stage0): Remove impl after a snapshot
2893+
#[cfg(stage0)]
28742894
impl ops::Sub<TypeContents,TypeContents> for TypeContents {
28752895
fn sub(&self, other: &TypeContents) -> TypeContents {
28762896
TypeContents {bits: self.bits & !other.bits}
28772897
}
28782898
}
28792899

2900+
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
2901+
impl ops::Sub<TypeContents, TypeContents> for TypeContents {
2902+
fn sub(self, other: TypeContents) -> TypeContents {
2903+
TypeContents {bits: self.bits & !other.bits}
2904+
}
2905+
}
2906+
28802907
impl fmt::Show for TypeContents {
28812908
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28822909
write!(f, "TypeContents({:b})", self.bits)

0 commit comments

Comments
 (0)