rustdoc: deny(deprecated_self)

This commit is contained in:
Brian Anderson 2013-01-30 19:56:17 -08:00
parent 366812a5c3
commit 7d8ae4403e
4 changed files with 23 additions and 24 deletions

View File

@ -164,7 +164,7 @@ trait TheShunnedHouse {
* * unkempt_yard - A yard dating from a time when the region was partly
* open country
*/
fn dingy_house(unkempt_yard: int);
fn dingy_house(&self, unkempt_yard: int);
/**
* The house was--and for that matter still is--of a kind to attract
@ -183,15 +183,15 @@ trait TheShunnedHouse {
* the removal of the bodies to the North Burial Ground made it
* decently possible to cut through the old family plots.
*/
fn construct() -> bool;
fn construct(&self) -> bool;
}
/// Whatever
impl OmNomNomy: TheShunnedHouse {
fn dingy_house(_unkempt_yard: int) {
fn dingy_house(&self, _unkempt_yard: int) {
}
fn construct() -> bool {
fn construct(&self) -> bool {
fail;
}
}

View File

@ -175,7 +175,7 @@ pub struct IndexEntry {
}
impl Doc {
fn CrateDoc() -> CrateDoc {
fn CrateDoc(&self) -> CrateDoc {
option::get(vec::foldl(None, self.pages, |_m, page| {
match copy *page {
doc::CratePage(doc) => Some(doc),
@ -184,14 +184,14 @@ impl Doc {
}))
}
fn cratemod() -> ModDoc {
fn cratemod(&self) -> ModDoc {
copy self.CrateDoc().topmod
}
}
/// Some helper methods on ModDoc, mostly for testing
impl ModDoc {
fn mods() -> ~[ModDoc] {
fn mods(&self) -> ~[ModDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
ModTag(ModDoc) => Some(ModDoc),
@ -200,7 +200,7 @@ impl ModDoc {
}
}
fn nmods() -> ~[NmodDoc] {
fn nmods(&self) -> ~[NmodDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
NmodTag(nModDoc) => Some(nModDoc),
@ -209,7 +209,7 @@ impl ModDoc {
}
}
fn fns() -> ~[FnDoc] {
fn fns(&self) -> ~[FnDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
FnTag(FnDoc) => Some(FnDoc),
@ -218,7 +218,7 @@ impl ModDoc {
}
}
fn consts() -> ~[ConstDoc] {
fn consts(&self) -> ~[ConstDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
ConstTag(ConstDoc) => Some(ConstDoc),
@ -227,7 +227,7 @@ impl ModDoc {
}
}
fn enums() -> ~[EnumDoc] {
fn enums(&self) -> ~[EnumDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
EnumTag(EnumDoc) => Some(EnumDoc),
@ -236,7 +236,7 @@ impl ModDoc {
}
}
fn traits() -> ~[TraitDoc] {
fn traits(&self) -> ~[TraitDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
TraitTag(TraitDoc) => Some(TraitDoc),
@ -245,7 +245,7 @@ impl ModDoc {
}
}
fn impls() -> ~[ImplDoc] {
fn impls(&self) -> ~[ImplDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
ImplTag(ImplDoc) => Some(ImplDoc),
@ -254,7 +254,7 @@ impl ModDoc {
}
}
fn types() -> ~[TyDoc] {
fn types(&self) -> ~[TyDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
TyTag(TyDoc) => Some(TyDoc),
@ -263,7 +263,7 @@ impl ModDoc {
}
}
fn structs() -> ~[StructDoc] {
fn structs(&self) -> ~[StructDoc] {
do vec::filter_map(self.items) |itemtag| {
match copy *itemtag {
StructTag(StructDoc) => Some(StructDoc),

View File

@ -38,22 +38,22 @@ pub type Writer = fn~(v: WriteInstr);
pub type WriterFactory = fn~(page: doc::Page) -> Writer;
pub trait WriterUtils {
fn write_str(+str: ~str);
fn write_line(+str: ~str);
fn write_done();
fn write_str(&self, +str: ~str);
fn write_line(&self, +str: ~str);
fn write_done(&self);
}
impl Writer: WriterUtils {
fn write_str(str: ~str) {
self(Write(str));
fn write_str(&self, str: ~str) {
(*self)(Write(str));
}
fn write_line(str: ~str) {
fn write_line(&self, str: ~str) {
self.write_str(str + ~"\n");
}
fn write_done() {
self(Done)
fn write_done(&self) {
(*self)(Done)
}
}

View File

@ -22,7 +22,6 @@
#[no_core];
#[allow(non_implicitly_copyable_typarams)];
#[allow(deprecated_self)];
extern mod core(vers = "0.6");
extern mod std(vers = "0.6");