Skip to content

Commit 7d8ae44

Browse files
committed
rustdoc: deny(deprecated_self)
1 parent 366812a commit 7d8ae44

File tree

4 files changed

+23
-24
lines changed

4 files changed

+23
-24
lines changed

src/librustdoc/demo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ trait TheShunnedHouse {
164164
* * unkempt_yard - A yard dating from a time when the region was partly
165165
* open country
166166
*/
167-
fn dingy_house(unkempt_yard: int);
167+
fn dingy_house(&self, unkempt_yard: int);
168168

169169
/**
170170
* The house was--and for that matter still is--of a kind to attract
@@ -183,15 +183,15 @@ trait TheShunnedHouse {
183183
* the removal of the bodies to the North Burial Ground made it
184184
* decently possible to cut through the old family plots.
185185
*/
186-
fn construct() -> bool;
186+
fn construct(&self) -> bool;
187187
}
188188

189189
/// Whatever
190190
impl OmNomNomy: TheShunnedHouse {
191-
fn dingy_house(_unkempt_yard: int) {
191+
fn dingy_house(&self, _unkempt_yard: int) {
192192
}
193193

194-
fn construct() -> bool {
194+
fn construct(&self) -> bool {
195195
fail;
196196
}
197197
}

src/librustdoc/doc.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub struct IndexEntry {
175175
}
176176

177177
impl Doc {
178-
fn CrateDoc() -> CrateDoc {
178+
fn CrateDoc(&self) -> CrateDoc {
179179
option::get(vec::foldl(None, self.pages, |_m, page| {
180180
match copy *page {
181181
doc::CratePage(doc) => Some(doc),
@@ -184,14 +184,14 @@ impl Doc {
184184
}))
185185
}
186186

187-
fn cratemod() -> ModDoc {
187+
fn cratemod(&self) -> ModDoc {
188188
copy self.CrateDoc().topmod
189189
}
190190
}
191191

192192
/// Some helper methods on ModDoc, mostly for testing
193193
impl ModDoc {
194-
fn mods() -> ~[ModDoc] {
194+
fn mods(&self) -> ~[ModDoc] {
195195
do vec::filter_map(self.items) |itemtag| {
196196
match copy *itemtag {
197197
ModTag(ModDoc) => Some(ModDoc),
@@ -200,7 +200,7 @@ impl ModDoc {
200200
}
201201
}
202202

203-
fn nmods() -> ~[NmodDoc] {
203+
fn nmods(&self) -> ~[NmodDoc] {
204204
do vec::filter_map(self.items) |itemtag| {
205205
match copy *itemtag {
206206
NmodTag(nModDoc) => Some(nModDoc),
@@ -209,7 +209,7 @@ impl ModDoc {
209209
}
210210
}
211211

212-
fn fns() -> ~[FnDoc] {
212+
fn fns(&self) -> ~[FnDoc] {
213213
do vec::filter_map(self.items) |itemtag| {
214214
match copy *itemtag {
215215
FnTag(FnDoc) => Some(FnDoc),
@@ -218,7 +218,7 @@ impl ModDoc {
218218
}
219219
}
220220

221-
fn consts() -> ~[ConstDoc] {
221+
fn consts(&self) -> ~[ConstDoc] {
222222
do vec::filter_map(self.items) |itemtag| {
223223
match copy *itemtag {
224224
ConstTag(ConstDoc) => Some(ConstDoc),
@@ -227,7 +227,7 @@ impl ModDoc {
227227
}
228228
}
229229

230-
fn enums() -> ~[EnumDoc] {
230+
fn enums(&self) -> ~[EnumDoc] {
231231
do vec::filter_map(self.items) |itemtag| {
232232
match copy *itemtag {
233233
EnumTag(EnumDoc) => Some(EnumDoc),
@@ -236,7 +236,7 @@ impl ModDoc {
236236
}
237237
}
238238

239-
fn traits() -> ~[TraitDoc] {
239+
fn traits(&self) -> ~[TraitDoc] {
240240
do vec::filter_map(self.items) |itemtag| {
241241
match copy *itemtag {
242242
TraitTag(TraitDoc) => Some(TraitDoc),
@@ -245,7 +245,7 @@ impl ModDoc {
245245
}
246246
}
247247

248-
fn impls() -> ~[ImplDoc] {
248+
fn impls(&self) -> ~[ImplDoc] {
249249
do vec::filter_map(self.items) |itemtag| {
250250
match copy *itemtag {
251251
ImplTag(ImplDoc) => Some(ImplDoc),
@@ -254,7 +254,7 @@ impl ModDoc {
254254
}
255255
}
256256

257-
fn types() -> ~[TyDoc] {
257+
fn types(&self) -> ~[TyDoc] {
258258
do vec::filter_map(self.items) |itemtag| {
259259
match copy *itemtag {
260260
TyTag(TyDoc) => Some(TyDoc),
@@ -263,7 +263,7 @@ impl ModDoc {
263263
}
264264
}
265265

266-
fn structs() -> ~[StructDoc] {
266+
fn structs(&self) -> ~[StructDoc] {
267267
do vec::filter_map(self.items) |itemtag| {
268268
match copy *itemtag {
269269
StructTag(StructDoc) => Some(StructDoc),

src/librustdoc/markdown_writer.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,22 @@ pub type Writer = fn~(v: WriteInstr);
3838
pub type WriterFactory = fn~(page: doc::Page) -> Writer;
3939

4040
pub trait WriterUtils {
41-
fn write_str(+str: ~str);
42-
fn write_line(+str: ~str);
43-
fn write_done();
41+
fn write_str(&self, +str: ~str);
42+
fn write_line(&self, +str: ~str);
43+
fn write_done(&self);
4444
}
4545

4646
impl Writer: WriterUtils {
47-
fn write_str(str: ~str) {
48-
self(Write(str));
47+
fn write_str(&self, str: ~str) {
48+
(*self)(Write(str));
4949
}
5050

51-
fn write_line(str: ~str) {
51+
fn write_line(&self, str: ~str) {
5252
self.write_str(str + ~"\n");
5353
}
5454

55-
fn write_done() {
56-
self(Done)
55+
fn write_done(&self) {
56+
(*self)(Done)
5757
}
5858
}
5959

src/librustdoc/rustdoc.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#[no_core];
2323

2424
#[allow(non_implicitly_copyable_typarams)];
25-
#[allow(deprecated_self)];
2625

2726
extern mod core(vers = "0.6");
2827
extern mod std(vers = "0.6");

0 commit comments

Comments
 (0)