From e7c60c141b6f499ba551b53bc562925269d2f187 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 22 Mar 2013 11:09:13 -0700 Subject: librustc: Remove `pure` from libsyntax and librustc. --- src/libsyntax/codemap.rs | 62 ++++++++++++++++++++++++------------------------ 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src/libsyntax/codemap.rs') diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 06d915cfed8..c082f4c0838 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -30,8 +30,8 @@ use core::uint; use std::serialize::{Encodable, Decodable, Encoder, Decoder}; pub trait Pos { - pure fn from_uint(n: uint) -> Self; - pure fn to_uint(&self) -> uint; + fn from_uint(n: uint) -> Self; + fn to_uint(&self) -> uint; } /// A byte offset @@ -45,71 +45,71 @@ pub struct CharPos(uint); // have been unsuccessful impl Pos for BytePos { - pure fn from_uint(n: uint) -> BytePos { BytePos(n) } - pure fn to_uint(&self) -> uint { **self } + fn from_uint(n: uint) -> BytePos { BytePos(n) } + fn to_uint(&self) -> uint { **self } } impl cmp::Eq for BytePos { - pure fn eq(&self, other: &BytePos) -> bool { **self == **other } - pure fn ne(&self, other: &BytePos) -> bool { !(*self).eq(other) } + fn eq(&self, other: &BytePos) -> bool { **self == **other } + fn ne(&self, other: &BytePos) -> bool { !(*self).eq(other) } } impl cmp::Ord for BytePos { - pure fn lt(&self, other: &BytePos) -> bool { **self < **other } - pure fn le(&self, other: &BytePos) -> bool { **self <= **other } - pure fn ge(&self, other: &BytePos) -> bool { **self >= **other } - pure fn gt(&self, other: &BytePos) -> bool { **self > **other } + fn lt(&self, other: &BytePos) -> bool { **self < **other } + fn le(&self, other: &BytePos) -> bool { **self <= **other } + fn ge(&self, other: &BytePos) -> bool { **self >= **other } + fn gt(&self, other: &BytePos) -> bool { **self > **other } } impl Add for BytePos { - pure fn add(&self, rhs: &BytePos) -> BytePos { + fn add(&self, rhs: &BytePos) -> BytePos { BytePos(**self + **rhs) } } impl Sub for BytePos { - pure fn sub(&self, rhs: &BytePos) -> BytePos { + fn sub(&self, rhs: &BytePos) -> BytePos { BytePos(**self - **rhs) } } impl to_bytes::IterBytes for BytePos { - pure fn iter_bytes(&self, +lsb0: bool, &&f: to_bytes::Cb) { + fn iter_bytes(&self, +lsb0: bool, &&f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f) } } impl Pos for CharPos { - pure fn from_uint(n: uint) -> CharPos { CharPos(n) } - pure fn to_uint(&self) -> uint { **self } + fn from_uint(n: uint) -> CharPos { CharPos(n) } + fn to_uint(&self) -> uint { **self } } impl cmp::Eq for CharPos { - pure fn eq(&self, other: &CharPos) -> bool { **self == **other } - pure fn ne(&self, other: &CharPos) -> bool { !(*self).eq(other) } + fn eq(&self, other: &CharPos) -> bool { **self == **other } + fn ne(&self, other: &CharPos) -> bool { !(*self).eq(other) } } impl cmp::Ord for CharPos { - pure fn lt(&self, other: &CharPos) -> bool { **self < **other } - pure fn le(&self, other: &CharPos) -> bool { **self <= **other } - pure fn ge(&self, other: &CharPos) -> bool { **self >= **other } - pure fn gt(&self, other: &CharPos) -> bool { **self > **other } + fn lt(&self, other: &CharPos) -> bool { **self < **other } + fn le(&self, other: &CharPos) -> bool { **self <= **other } + fn ge(&self, other: &CharPos) -> bool { **self >= **other } + fn gt(&self, other: &CharPos) -> bool { **self > **other } } impl to_bytes::IterBytes for CharPos { - pure fn iter_bytes(&self, +lsb0: bool, &&f: to_bytes::Cb) { + fn iter_bytes(&self, +lsb0: bool, &&f: to_bytes::Cb) { (**self).iter_bytes(lsb0, f) } } impl Add for CharPos { - pure fn add(&self, rhs: &CharPos) -> CharPos { + fn add(&self, rhs: &CharPos) -> CharPos { CharPos(**self + **rhs) } } impl Sub for CharPos { - pure fn sub(&self, rhs: &CharPos) -> CharPos { + fn sub(&self, rhs: &CharPos) -> CharPos { CharPos(**self - **rhs) } } @@ -132,10 +132,10 @@ pub struct span { pub struct spanned { node: T, span: span } impl cmp::Eq for span { - pure fn eq(&self, other: &span) -> bool { + fn eq(&self, other: &span) -> bool { return (*self).lo == (*other).lo && (*self).hi == (*other).hi; } - pure fn ne(&self, other: &span) -> bool { !(*self).eq(other) } + fn ne(&self, other: &span) -> bool { !(*self).eq(other) } } impl Encodable for span { @@ -149,25 +149,25 @@ impl Decodable for span { } } -pub pure fn spanned(+lo: BytePos, +hi: BytePos, +t: T) -> spanned { +pub fn spanned(+lo: BytePos, +hi: BytePos, +t: T) -> spanned { respan(mk_sp(lo, hi), t) } -pub pure fn respan(sp: span, +t: T) -> spanned { +pub fn respan(sp: span, +t: T) -> spanned { spanned {node: t, span: sp} } -pub pure fn dummy_spanned(+t: T) -> spanned { +pub fn dummy_spanned(+t: T) -> spanned { respan(dummy_sp(), t) } /* assuming that we're not in macro expansion */ -pub pure fn mk_sp(+lo: BytePos, +hi: BytePos) -> span { +pub fn mk_sp(+lo: BytePos, +hi: BytePos) -> span { span {lo: lo, hi: hi, expn_info: None} } // make this a const, once the compiler supports it -pub pure fn dummy_sp() -> span { return mk_sp(BytePos(0), BytePos(0)); } +pub fn dummy_sp() -> span { return mk_sp(BytePos(0), BytePos(0)); } -- cgit 1.4.1-3-g733a5