Skip to content

Commit fbe22af

Browse files
committed
librustdoc: Remove pure from fuzzer and rustdoc.
1 parent e7c60c1 commit fbe22af

File tree

9 files changed

+38
-38
lines changed

9 files changed

+38
-38
lines changed

src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ pub fn split_no_trailing(s: &str, sepfn: &fn(char) -> bool) -> ~[~str] {
525525
split_inner(s, sepfn, len(s), true, false)
526526
}
527527

528-
pure fn split_inner(s: &str, sepfn: &fn(cc: char) -> bool, count: uint,
528+
fn split_inner(s: &str, sepfn: &fn(cc: char) -> bool, count: uint,
529529
allow_empty: bool, allow_trailing_empty: bool) -> ~[~str] {
530530
let l = len(s);
531531
let mut result = ~[], i = 0u, start = 0u, done = 0u;

src/libfuzzer/ast_match.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ fn vec_equal<T>(v: ~[T],
2525
return true;
2626
}
2727

28-
pure fn builtin_equal<T>(&&a: T, &&b: T) -> bool { return a == b; }
29-
pure fn builtin_equal_int(&&a: int, &&b: int) -> bool { return a == b; }
28+
fn builtin_equal<T>(&&a: T, &&b: T) -> bool { return a == b; }
29+
fn builtin_equal_int(&&a: int, &&b: int) -> bool { return a == b; }
3030

3131
fn main() {
3232
fail_unless!((builtin_equal(5, 5)));

src/libfuzzer/fuzzer.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ pub fn common_exprs() -> ~[ast::expr] {
9595
]
9696
}
9797

98-
pub pure fn safe_to_steal_expr(e: @ast::expr, tm: test_mode) -> bool {
98+
pub fn safe_to_steal_expr(e: @ast::expr, tm: test_mode) -> bool {
9999
safe_to_use_expr(*e, tm)
100100
}
101101

102-
pub pure fn safe_to_use_expr(e: ast::expr, tm: test_mode) -> bool {
102+
pub fn safe_to_use_expr(e: ast::expr, tm: test_mode) -> bool {
103103
match tm {
104104
tm_converge => {
105105
match e.node {

src/librustdoc/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ pub enum OutputFormat {
2929
}
3030

3131
impl cmp::Eq for OutputFormat {
32-
pure fn eq(&self, other: &OutputFormat) -> bool {
32+
fn eq(&self, other: &OutputFormat) -> bool {
3333
((*self) as uint) == ((*other) as uint)
3434
}
35-
pure fn ne(&self, other: &OutputFormat) -> bool { !(*self).eq(other) }
35+
fn ne(&self, other: &OutputFormat) -> bool { !(*self).eq(other) }
3636
}
3737

3838
/// How to organize the output
@@ -44,10 +44,10 @@ pub enum OutputStyle {
4444
}
4545

4646
impl cmp::Eq for OutputStyle {
47-
pure fn eq(&self, other: &OutputStyle) -> bool {
47+
fn eq(&self, other: &OutputStyle) -> bool {
4848
((*self) as uint) == ((*other) as uint)
4949
}
50-
pure fn ne(&self, other: &OutputStyle) -> bool { !(*self).eq(other) }
50+
fn ne(&self, other: &OutputStyle) -> bool { !(*self).eq(other) }
5151
}
5252

5353
/// The configuration for a rustdoc session

src/librustdoc/doc.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,11 @@ impl PageUtils for ~[Page] {
358358
}
359359

360360
pub trait Item {
361-
pure fn item(&self) -> ItemDoc;
361+
fn item(&self) -> ItemDoc;
362362
}
363363

364364
impl Item for ItemTag {
365-
pure fn item(&self) -> ItemDoc {
365+
fn item(&self) -> ItemDoc {
366366
match self {
367367
&doc::ModTag(ref doc) => copy doc.item,
368368
&doc::NmodTag(ref doc) => copy doc.item,
@@ -378,64 +378,64 @@ impl Item for ItemTag {
378378
}
379379

380380
impl Item for SimpleItemDoc {
381-
pure fn item(&self) -> ItemDoc { copy self.item }
381+
fn item(&self) -> ItemDoc { copy self.item }
382382
}
383383

384384
impl Item for ModDoc {
385-
pure fn item(&self) -> ItemDoc { copy self.item }
385+
fn item(&self) -> ItemDoc { copy self.item }
386386
}
387387

388388
impl Item for NmodDoc {
389-
pure fn item(&self) -> ItemDoc { copy self.item }
389+
fn item(&self) -> ItemDoc { copy self.item }
390390
}
391391

392392
impl Item for EnumDoc {
393-
pure fn item(&self) -> ItemDoc { copy self.item }
393+
fn item(&self) -> ItemDoc { copy self.item }
394394
}
395395

396396
impl Item for TraitDoc {
397-
pure fn item(&self) -> ItemDoc { copy self.item }
397+
fn item(&self) -> ItemDoc { copy self.item }
398398
}
399399

400400
impl Item for ImplDoc {
401-
pure fn item(&self) -> ItemDoc { copy self.item }
401+
fn item(&self) -> ItemDoc { copy self.item }
402402
}
403403

404404
impl Item for StructDoc {
405-
pure fn item(&self) -> ItemDoc { copy self.item }
405+
fn item(&self) -> ItemDoc { copy self.item }
406406
}
407407

408408
pub trait ItemUtils {
409-
pure fn id(&self) -> AstId;
410-
pure fn name(&self) -> ~str;
411-
pure fn path(&self) -> ~[~str];
412-
pure fn brief(&self) -> Option<~str>;
413-
pure fn desc(&self) -> Option<~str>;
414-
pure fn sections(&self) -> ~[Section];
409+
fn id(&self) -> AstId;
410+
fn name(&self) -> ~str;
411+
fn path(&self) -> ~[~str];
412+
fn brief(&self) -> Option<~str>;
413+
fn desc(&self) -> Option<~str>;
414+
fn sections(&self) -> ~[Section];
415415
}
416416

417417
impl<A:Item> ItemUtils for A {
418-
pure fn id(&self) -> AstId {
418+
fn id(&self) -> AstId {
419419
self.item().id
420420
}
421421

422-
pure fn name(&self) -> ~str {
422+
fn name(&self) -> ~str {
423423
copy self.item().name
424424
}
425425

426-
pure fn path(&self) -> ~[~str] {
426+
fn path(&self) -> ~[~str] {
427427
copy self.item().path
428428
}
429429

430-
pure fn brief(&self) -> Option<~str> {
430+
fn brief(&self) -> Option<~str> {
431431
copy self.item().brief
432432
}
433433

434-
pure fn desc(&self) -> Option<~str> {
434+
fn desc(&self) -> Option<~str> {
435435
copy self.item().desc
436436
}
437437

438-
pure fn sections(&self) -> ~[Section] {
438+
fn sections(&self) -> ~[Section] {
439439
copy self.item().sections
440440
}
441441
}

src/librustdoc/markdown_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ fn run(
4545
writer_factory: WriterFactory
4646
) -> doc::Doc {
4747

48-
pure fn mods_last(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
49-
pure fn is_mod(item: &doc::ItemTag) -> bool {
48+
fn mods_last(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
49+
fn is_mod(item: &doc::ItemTag) -> bool {
5050
match *item {
5151
doc::ModTag(_) => true,
5252
_ => false

src/librustdoc/sort_item_name_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use pass::Pass;
1616
use sort_pass;
1717

1818
pub fn mk_pass() -> Pass {
19-
pure fn by_item_name(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
19+
fn by_item_name(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
2020
(*item1).name() <= (*item2).name()
2121
}
2222
sort_pass::mk_pass(~"sort_item_name", by_item_name)

src/librustdoc/sort_item_type_pass.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use pass::Pass;
1515
use sort_pass;
1616

1717
pub fn mk_pass() -> Pass {
18-
pure fn by_score(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
19-
pure fn score(item: &doc::ItemTag) -> int {
18+
fn by_score(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
19+
fn score(item: &doc::ItemTag) -> int {
2020
match *item {
2121
doc::ConstTag(_) => 0,
2222
doc::TyTag(_) => 1,

src/librustdoc/sort_pass.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use util::NominalOp;
2121

2222
use std::sort;
2323

24-
pub type ItemLtEqOp = @pure fn(v1: &doc::ItemTag, v2: &doc::ItemTag) -> bool;
24+
pub type ItemLtEqOp = @fn(v1: &doc::ItemTag, v2: &doc::ItemTag) -> bool;
2525

2626
type ItemLtEq = NominalOp<ItemLtEqOp>;
2727

@@ -59,7 +59,7 @@ fn fold_mod(
5959

6060
#[test]
6161
fn test() {
62-
pure fn name_lteq(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
62+
fn name_lteq(item1: &doc::ItemTag, item2: &doc::ItemTag) -> bool {
6363
(*item1).name() <= (*item2).name()
6464
}
6565

@@ -76,7 +76,7 @@ fn test() {
7676
7777
#[test]
7878
fn should_be_stable() {
79-
pure fn always_eq(_item1: &doc::ItemTag, _item2: &doc::ItemTag) -> bool {
79+
fn always_eq(_item1: &doc::ItemTag, _item2: &doc::ItemTag) -> bool {
8080
true
8181
}
8282

0 commit comments

Comments
 (0)