Skip to content

Commit e7c60c1

Browse files
committed
librustc: Remove pure from libsyntax and librustc.
1 parent ec59ce5 commit e7c60c1

31 files changed

+251
-252
lines changed

src/librustc/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use core::util;
2020
use core::vec;
2121
use core::hashmap::linear::LinearSet;
2222

23-
pure fn not_win32(os: session::os) -> bool {
23+
fn not_win32(os: session::os) -> bool {
2424
match os {
2525
session::os_win32 => false,
2626
_ => true

src/librustc/metadata/decoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ pub fn get_item_attrs(cdata: cmd,
872872
}
873873
}
874874

875-
pure fn struct_field_family_to_visibility(family: Family) -> ast::visibility {
875+
fn struct_field_family_to_visibility(family: Family) -> ast::visibility {
876876
match family {
877877
PublicField => ast::public,
878878
PrivateField => ast::private,

src/librustc/middle/borrowck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ pub impl LoanKind {
444444
/// Creates and returns a new root_map
445445
446446
impl to_bytes::IterBytes for root_map_key {
447-
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
447+
fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
448448
to_bytes::iter_bytes_2(&self.id, &self.derefs, lsb0, f);
449449
}
450450
}

src/librustc/middle/lint.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ fn check_item_while_true(cx: ty::ctxt, it: @ast::item) {
534534
}
535535

536536
fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
537-
pure fn is_valid<T:cmp::Ord>(binop: ast::binop, v: T,
537+
fn is_valid<T:cmp::Ord>(binop: ast::binop, v: T,
538538
min: T, max: T) -> bool {
539539
match binop {
540540
ast::lt => v <= max,
@@ -546,7 +546,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
546546
}
547547
}
548548

549-
pure fn rev_binop(binop: ast::binop) -> ast::binop {
549+
fn rev_binop(binop: ast::binop) -> ast::binop {
550550
match binop {
551551
ast::lt => ast::gt,
552552
ast::le => ast::ge,
@@ -556,7 +556,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
556556
}
557557
}
558558

559-
pure fn int_ty_range(int_ty: ast::int_ty) -> (i64, i64) {
559+
fn int_ty_range(int_ty: ast::int_ty) -> (i64, i64) {
560560
match int_ty {
561561
ast::ty_i => (int::min_value as i64, int::max_value as i64),
562562
ast::ty_char => (u32::min_value as i64, u32::max_value as i64),
@@ -567,7 +567,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
567567
}
568568
}
569569

570-
pure fn uint_ty_range(uint_ty: ast::uint_ty) -> (u64, u64) {
570+
fn uint_ty_range(uint_ty: ast::uint_ty) -> (u64, u64) {
571571
match uint_ty {
572572
ast::ty_u => (uint::min_value as u64, uint::max_value as u64),
573573
ast::ty_u8 => (u8::min_value as u64, u8::max_value as u64),
@@ -622,7 +622,7 @@ fn check_item_type_limits(cx: ty::ctxt, it: @ast::item) {
622622
}
623623
}
624624

625-
pure fn is_comparison(binop: ast::binop) -> bool {
625+
fn is_comparison(binop: ast::binop) -> bool {
626626
match binop {
627627
ast::eq | ast::lt | ast::le |
628628
ast::ne | ast::ge | ast::gt => true,

src/librustc/middle/liveness.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ struct Variable(uint);
141141
struct LiveNode(uint);
142142

143143
impl cmp::Eq for Variable {
144-
pure fn eq(&self, other: &Variable) -> bool { *(*self) == *(*other) }
145-
pure fn ne(&self, other: &Variable) -> bool { *(*self) != *(*other) }
144+
fn eq(&self, other: &Variable) -> bool { *(*self) == *(*other) }
145+
fn ne(&self, other: &Variable) -> bool { *(*self) != *(*other) }
146146
}
147147

148148
impl cmp::Eq for LiveNode {
149-
pure fn eq(&self, other: &LiveNode) -> bool { *(*self) == *(*other) }
150-
pure fn ne(&self, other: &LiveNode) -> bool { *(*self) != *(*other) }
149+
fn eq(&self, other: &LiveNode) -> bool { *(*self) == *(*other) }
150+
fn ne(&self, other: &LiveNode) -> bool { *(*self) != *(*other) }
151151
}
152152

153153
enum LiveNodeKind {
@@ -158,7 +158,7 @@ enum LiveNodeKind {
158158
}
159159

160160
impl cmp::Eq for LiveNodeKind {
161-
pure fn eq(&self, other: &LiveNodeKind) -> bool {
161+
fn eq(&self, other: &LiveNodeKind) -> bool {
162162
match (*self) {
163163
FreeVarNode(e0a) => {
164164
match (*other) {
@@ -186,7 +186,7 @@ impl cmp::Eq for LiveNodeKind {
186186
}
187187
}
188188
}
189-
pure fn ne(&self, other: &LiveNodeKind) -> bool { !(*self).eq(other) }
189+
fn ne(&self, other: &LiveNodeKind) -> bool { !(*self).eq(other) }
190190
}
191191

192192
fn live_node_kind_to_str(lnk: LiveNodeKind, cx: ty::ctxt) -> ~str {
@@ -224,11 +224,11 @@ pub fn check_crate(tcx: ty::ctxt,
224224
}
225225

226226
impl to_str::ToStr for LiveNode {
227-
pure fn to_str(&self) -> ~str { fmt!("ln(%u)", **self) }
227+
fn to_str(&self) -> ~str { fmt!("ln(%u)", **self) }
228228
}
229229

230230
impl to_str::ToStr for Variable {
231-
pure fn to_str(&self) -> ~str { fmt!("v(%u)", **self) }
231+
fn to_str(&self) -> ~str { fmt!("v(%u)", **self) }
232232
}
233233

234234
// ______________________________________________________________________
@@ -254,7 +254,7 @@ impl to_str::ToStr for Variable {
254254
// assignment. And so forth.
255255

256256
pub impl LiveNode {
257-
pure fn is_valid(&self) -> bool { **self != uint::max_value }
257+
fn is_valid(&self) -> bool { **self != uint::max_value }
258258
}
259259

260260
fn invalid_node() -> LiveNode { LiveNode(uint::max_value) }

src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub struct mem_categorization_ctxt {
305305
}
306306

307307
impl ToStr for MutabilityCategory {
308-
pure fn to_str(&self) -> ~str {
308+
fn to_str(&self) -> ~str {
309309
fmt!("%?", *self)
310310
}
311311
}

src/librustc/middle/resolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub enum NamespaceResult {
151151
}
152152

153153
pub impl NamespaceResult {
154-
pure fn is_unknown(&self) -> bool {
154+
fn is_unknown(&self) -> bool {
155155
match *self {
156156
UnknownResult => true,
157157
_ => false

src/librustc/middle/trans/cabi_x86_64.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ enum x86_64_reg_class {
4141
}
4242

4343
impl cmp::Eq for x86_64_reg_class {
44-
pure fn eq(&self, other: &x86_64_reg_class) -> bool {
44+
fn eq(&self, other: &x86_64_reg_class) -> bool {
4545
((*self) as uint) == ((*other) as uint)
4646
}
47-
pure fn ne(&self, other: &x86_64_reg_class) -> bool { !(*self).eq(other) }
47+
fn ne(&self, other: &x86_64_reg_class) -> bool { !(*self).eq(other) }
4848
}
4949

5050
fn is_sse(++c: x86_64_reg_class) -> bool {

src/librustc/middle/trans/common.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,9 @@ pub fn block_parent(cx: block) -> block {
678678
// Accessors
679679

680680
pub impl block_ {
681-
pure fn ccx(@mut self) -> @CrateContext { *self.fcx.ccx }
682-
pure fn tcx(@mut self) -> ty::ctxt { self.fcx.ccx.tcx }
683-
pure fn sess(@mut self) -> Session { self.fcx.ccx.sess }
681+
fn ccx(@mut self) -> @CrateContext { *self.fcx.ccx }
682+
fn tcx(@mut self) -> ty::ctxt { self.fcx.ccx.tcx }
683+
fn sess(@mut self) -> Session { self.fcx.ccx.sess }
684684

685685
fn node_id_to_str(@mut self, id: ast::node_id) -> ~str {
686686
ast_map::node_id_to_str(self.tcx().items, id, self.sess().intr())
@@ -1290,7 +1290,7 @@ pub struct mono_id_ {
12901290
pub type mono_id = @mono_id_;
12911291
12921292
impl to_bytes::IterBytes for mono_param_id {
1293-
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
1293+
fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
12941294
match *self {
12951295
mono_precise(t, ref mids) =>
12961296
to_bytes::iter_bytes_3(&0u8, &ty::type_id(t), mids, lsb0, f),
@@ -1304,7 +1304,7 @@ impl to_bytes::IterBytes for mono_param_id {
13041304
}
13051305
13061306
impl to_bytes::IterBytes for mono_id_ {
1307-
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
1307+
fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
13081308
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);
13091309
}
13101310
}

src/librustc/middle/trans/datum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ pub impl DatumMode {
158158
}
159159

160160
impl cmp::Eq for DatumMode {
161-
pure fn eq(&self, other: &DatumMode) -> bool {
161+
fn eq(&self, other: &DatumMode) -> bool {
162162
(*self) as uint == (*other as uint)
163163
}
164-
pure fn ne(&self, other: &DatumMode) -> bool { !(*self).eq(other) }
164+
fn ne(&self, other: &DatumMode) -> bool { !(*self).eq(other) }
165165
}
166166

167167
impl to_bytes::IterBytes for DatumMode {
168-
pure fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
168+
fn iter_bytes(&self, +lsb0: bool, f: to_bytes::Cb) {
169169
(*self as uint).iter_bytes(lsb0, f)
170170
}
171171
}

src/librustc/middle/trans/expr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@ pub impl Dest {
175175
}
176176

177177
impl cmp::Eq for Dest {
178-
pure fn eq(&self, other: &Dest) -> bool {
178+
fn eq(&self, other: &Dest) -> bool {
179179
match ((*self), (*other)) {
180180
(SaveIn(e0a), SaveIn(e0b)) => e0a == e0b,
181181
(Ignore, Ignore) => true,
182182
(SaveIn(*), _) => false,
183183
(Ignore, _) => false,
184184
}
185185
}
186-
pure fn ne(&self, other: &Dest) -> bool { !(*self).eq(other) }
186+
fn ne(&self, other: &Dest) -> bool { !(*self).eq(other) }
187187
}
188188

189189
fn drop_and_cancel_clean(bcx: block, dat: Datum) -> block {
@@ -1695,7 +1695,7 @@ pub enum cast_kind {
16951695
}
16961696
16971697
impl cmp::Eq for cast_kind {
1698-
pure fn eq(&self, other: &cast_kind) -> bool {
1698+
fn eq(&self, other: &cast_kind) -> bool {
16991699
match ((*self), (*other)) {
17001700
(cast_pointer, cast_pointer) => true,
17011701
(cast_integral, cast_integral) => true,
@@ -1709,7 +1709,7 @@ impl cmp::Eq for cast_kind {
17091709
(cast_other, _) => false,
17101710
}
17111711
}
1712-
pure fn ne(&self, other: &cast_kind) -> bool { !(*self).eq(other) }
1712+
fn ne(&self, other: &cast_kind) -> bool { !(*self).eq(other) }
17131713
}
17141714
17151715
pub fn cast_type_kind(t: ty::t) -> cast_kind {

src/librustc/middle/trans/glue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ pub fn simplified_glue_type(tcx: ty::ctxt, field: uint, t: ty::t) -> ty::t {
218218
return t;
219219
}
220220

221-
pub pure fn cast_glue(ccx: @CrateContext, ti: @mut tydesc_info, v: ValueRef)
222-
-> ValueRef {
221+
pub fn cast_glue(ccx: @CrateContext, ti: @mut tydesc_info, v: ValueRef)
222+
-> ValueRef {
223223
unsafe {
224224
let llfnty = type_of_glue_fn(ccx, ti.ty);
225225
llvm::LLVMConstPointerCast(v, T_ptr(llfnty))

0 commit comments

Comments
 (0)