diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 11:10:53 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-03-22 12:57:28 -0700 |
| commit | fbe22afdbe4d1b612ba722551ba1c099e7f3e0b0 (patch) | |
| tree | 0118c47a5d40d1cde310a38f576185a48427aae7 /src | |
| parent | e7c60c141b6f499ba551b53bc562925269d2f187 (diff) | |
| download | rust-fbe22afdbe4d1b612ba722551ba1c099e7f3e0b0.tar.gz rust-fbe22afdbe4d1b612ba722551ba1c099e7f3e0b0.zip | |
librustdoc: Remove `pure` from fuzzer and rustdoc.
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/str.rs | 2 | ||||
| -rw-r--r-- | src/libfuzzer/ast_match.rs | 4 | ||||
| -rw-r--r-- | src/libfuzzer/fuzzer.rc | 4 | ||||
| -rw-r--r-- | src/librustdoc/config.rs | 8 | ||||
| -rw-r--r-- | src/librustdoc/doc.rs | 42 | ||||
| -rw-r--r-- | src/librustdoc/markdown_pass.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/sort_item_name_pass.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/sort_item_type_pass.rs | 4 | ||||
| -rw-r--r-- | src/librustdoc/sort_pass.rs | 6 |
9 files changed, 38 insertions, 38 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index d9202f4c61c..fc4d1e387dd 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -525,7 +525,7 @@ pub fn split_no_trailing(s: &str, sepfn: &fn(char) -> bool) -> ~[~str] { split_inner(s, sepfn, len(s), true, false) } -pure fn split_inner(s: &str, sepfn: &fn(cc: char) -> bool, count: uint, +fn split_inner(s: &str, sepfn: &fn(cc: char) -> bool, count: uint, allow_empty: bool, allow_trailing_empty: bool) -> ~[~str] { let l = len(s); let mut result = ~[], i = 0u, start = 0u, done = 0u; diff --git a/src/libfuzzer/ast_match.rs b/src/libfuzzer/ast_match.rs index 81048a69ca9..eedd3bebedf 100644 --- a/src/libfuzzer/ast_match.rs +++ b/src/libfuzzer/ast_match.rs @@ -25,8 +25,8 @@ fn vec_equal<T>(v: ~[T], return true; } -pure fn builtin_equal<T>(&&a: T, &&b: T) -> bool { return a == b; } -pure fn builtin_equal_int(&&a: int, &&b: int) -> bool { return a == b; } +fn builtin_equal<T>(&&a: T, &&b: T) -> bool { return a == b; } +fn builtin_equal_int(&&a: int, &&b: int) -> bool { return a == b; } fn main() { fail_unless!((builtin_equal(5, 5))); diff --git a/src/libfuzzer/fuzzer.rc b/src/libfuzzer/fuzzer.rc index 21015a767b7..71f7072fa7f 100644 --- a/src/libfuzzer/fuzzer.rc +++ b/src/libfuzzer/fuzzer.rc @@ -95,11 +95,11 @@ pub fn common_exprs() -> ~[ast::expr] { ] } -pub pure fn safe_to_steal_expr(e: @ast::expr, tm: test_mode) -> bool { +pub fn safe_to_steal_expr(e: @ast::expr, tm: test_mode) -> bool { safe_to_use_expr(*e, tm) } -pub pure fn safe_to_use_expr(e: ast::expr, tm: test_mode) -> bool { +pub fn safe_to_use_expr(e: ast::expr, tm: test_mode) -> bool { match tm { tm_converge => { match e.node { diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs index 956d6ba2c5b..84f2f5191f3 100644 --- a/src/librustdoc/config.rs +++ b/src/librustdoc/config.rs @@ -29,10 +29,10 @@ pub enum OutputFormat { } impl cmp::Eq for OutputFormat { - pure fn eq(&self, other: &OutputFormat) -> bool { + fn eq(&self, other: &OutputFormat) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &OutputFormat) -> bool { !(*self).eq(other) } + fn ne(&self, other: &OutputFormat) -> bool { !(*self).eq(other) } } /// How to organize the output @@ -44,10 +44,10 @@ pub enum OutputStyle { } impl cmp::Eq for OutputStyle { - pure fn eq(&self, other: &OutputStyle) -> bool { + fn eq(&self, other: &OutputStyle) -> bool { ((*self) as uint) == ((*other) as uint) } - pure fn ne(&self, other: &OutputStyle) -> bool { !(*self).eq(other) } + fn ne(&self, other: &OutputStyle) -> bool { !(*self).eq(other) } } /// The configuration for a rustdoc session diff --git a/src/librustdoc/doc.rs b/src/librustdoc/doc.rs index 43172fd22c0..4ed510c353b 100644 --- a/src/librustdoc/doc.rs +++ b/src/librustdoc/doc.rs @@ -358,11 +358,11 @@ impl PageUtils for ~[Page] { } pub trait Item { - pure fn item(&self) -> ItemDoc; + fn item(&self) -> ItemDoc; } impl Item for ItemTag { - pure fn item(&self) -> ItemDoc { + fn item(&self) -> ItemDoc { match self { &doc::ModTag(ref doc) => copy doc.item, &doc::NmodTag(ref doc) => copy doc.item, @@ -378,64 +378,64 @@ impl Item for ItemTag { } impl Item for SimpleItemDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } impl Item for ModDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } impl Item for NmodDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } impl Item for EnumDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } impl Item for TraitDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } impl Item for ImplDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } impl Item for StructDoc { - pure fn item(&self) -> ItemDoc { copy self.item } + fn item(&self) -> ItemDoc { copy self.item } } pub trait ItemUtils { - pure fn id(&self) -> AstId; - pure fn name(&self) -> ~str; - pure fn path(&self) -> ~[~str]; - pure fn brief(&self) -> Option<~str>; - pure fn desc(&self) -> Option<~str>; - pure fn sections(&self) -> ~[Section]; + fn id(&self) -> AstId; + fn name(&self) -> ~str; + fn path(&self) -> ~[~str]; + fn brief(&self) -> Option<~str>; + fn desc(&self) -> Option<~str>; + fn sections(&self) -> ~[Section]; } impl<A:Item> ItemUtils for A { - pure fn id(&self) -> AstId { + fn id(&self) -> AstId { self.item().id } - pure fn name(&self) -> ~str { + fn name(&self) -> ~str { copy self.item().name } - pure fn path(&self) -> ~[~str] { + fn path(&self) -> ~[~str] { copy self.item().path } - pure fn brief(&self) -> Option<~str> { + fn brief(&self) -> Option<~str> { copy self.item().brief } - pure fn desc(&self) -> Option<~str> { + fn desc(&self) -> Option<~str> { copy self.item().desc } - pure fn sections(&self) -> ~[Section] { + fn sections(&self) -> ~[Section] { copy self.item().sections } } diff --git a/src/librustdoc/markdown_pass.rs b/src/librustdoc/markdown_pass.rs index 6cb840fb937..227eb25aa81 100644 --- a/src/librustdoc/markdown_pass.rs +++ b/src/librustdoc/markdown_pass.rs @@ -45,8 +45,8 @@ fn run( writer_factory: WriterFactory ) -> doc::Doc { - pure fn mods_last(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { - pure fn is_mod(item: &doc::ItemTag) -> bool { + fn mods_last(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { + fn is_mod(item: &doc::ItemTag) -> bool { match *item { doc::ModTag(_) => true, _ => false diff --git a/src/librustdoc/sort_item_name_pass.rs b/src/librustdoc/sort_item_name_pass.rs index 0e6d83fa45f..b3fb874cdb2 100644 --- a/src/librustdoc/sort_item_name_pass.rs +++ b/src/librustdoc/sort_item_name_pass.rs @@ -16,7 +16,7 @@ use pass::Pass; use sort_pass; pub fn mk_pass() -> Pass { - pure fn by_item_name(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { + fn by_item_name(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { (*item1).name() <= (*item2).name() } sort_pass::mk_pass(~"sort_item_name", by_item_name) diff --git a/src/librustdoc/sort_item_type_pass.rs b/src/librustdoc/sort_item_type_pass.rs index cddd5068816..96727f6386d 100644 --- a/src/librustdoc/sort_item_type_pass.rs +++ b/src/librustdoc/sort_item_type_pass.rs @@ -15,8 +15,8 @@ use pass::Pass; use sort_pass; pub fn mk_pass() -> Pass { - pure fn by_score(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { - pure fn score(item: &doc::ItemTag) -> int { + fn by_score(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { + fn score(item: &doc::ItemTag) -> int { match *item { doc::ConstTag(_) => 0, doc::TyTag(_) => 1, diff --git a/src/librustdoc/sort_pass.rs b/src/librustdoc/sort_pass.rs index 4f4c5ea65d4..e66eb3c0fae 100644 --- a/src/librustdoc/sort_pass.rs +++ b/src/librustdoc/sort_pass.rs @@ -21,7 +21,7 @@ use util::NominalOp; use std::sort; -pub type ItemLtEqOp = @pure fn(v1: &doc::ItemTag, v2: &doc::ItemTag) -> bool; +pub type ItemLtEqOp = @fn(v1: &doc::ItemTag, v2: &doc::ItemTag) -> bool; type ItemLtEq = NominalOp<ItemLtEqOp>; @@ -59,7 +59,7 @@ fn fold_mod( #[test] fn test() { - pure fn name_lteq(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { + fn name_lteq(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool { (*item1).name() <= (*item2).name() } @@ -76,7 +76,7 @@ fn test() { #[test] fn should_be_stable() { - pure fn always_eq(_item1: &doc::ItemTag, _item2: &doc::ItemTag) -> bool { + fn always_eq(_item1: &doc::ItemTag, _item2: &doc::ItemTag) -> bool { true } |
