Skip to content

Commit 7bb78f7

Browse files
committed
Implement #[deprecated] attribute (RFC 1270)
1 parent a2529b9 commit 7bb78f7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

clean/inline.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ fn try_inline_def(cx: &DocContext, tcx: &ty::ctxt,
120120
attrs: load_attrs(cx, tcx, did),
121121
inner: inner,
122122
visibility: Some(hir::Public),
123-
stability: stability::lookup(tcx, did).clean(cx),
123+
stability: stability::lookup_stability(tcx, did).clean(cx),
124124
def_id: did,
125125
});
126126
Some(ret)
@@ -303,7 +303,7 @@ pub fn build_impl(cx: &DocContext,
303303
name: None,
304304
attrs: attrs,
305305
visibility: Some(hir::Inherited),
306-
stability: stability::lookup(tcx, did).clean(cx),
306+
stability: stability::lookup_stability(tcx, did).clean(cx),
307307
def_id: did,
308308
});
309309
}
@@ -333,7 +333,7 @@ pub fn build_impl(cx: &DocContext,
333333
source: clean::Span::empty(),
334334
attrs: vec![],
335335
visibility: None,
336-
stability: stability::lookup(tcx, did).clean(cx),
336+
stability: stability::lookup_stability(tcx, did).clean(cx),
337337
def_id: did
338338
})
339339
}
@@ -381,7 +381,7 @@ pub fn build_impl(cx: &DocContext,
381381
source: clean::Span::empty(),
382382
attrs: vec![],
383383
visibility: None,
384-
stability: stability::lookup(tcx, did).clean(cx),
384+
stability: stability::lookup_stability(tcx, did).clean(cx),
385385
def_id: did
386386
})
387387
}
@@ -414,7 +414,7 @@ pub fn build_impl(cx: &DocContext,
414414
name: None,
415415
attrs: attrs,
416416
visibility: Some(hir::Inherited),
417-
stability: stability::lookup(tcx, did).clean(cx),
417+
stability: stability::lookup_stability(tcx, did).clean(cx),
418418
def_id: did,
419419
});
420420

clean/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ mod simplify;
6262

6363
// extract the stability index for a node from tcx, if possible
6464
fn get_stability(cx: &DocContext, def_id: DefId) -> Option<Stability> {
65-
cx.tcx_opt().and_then(|tcx| stability::lookup(tcx, def_id)).clean(cx)
65+
cx.tcx_opt().and_then(|tcx| stability::lookup_stability(tcx, def_id)).clean(cx)
6666
}
6767

6868
pub trait Clean<T> {
@@ -2689,12 +2689,12 @@ impl Clean<Stability> for attr::Stability {
26892689
attr::Stable {ref since} => since.to_string(),
26902690
_ => "".to_string(),
26912691
},
2692-
deprecated_since: match self.depr {
2693-
Some(attr::Deprecation {ref since, ..}) => since.to_string(),
2692+
deprecated_since: match self.rustc_depr {
2693+
Some(attr::RustcDeprecation {ref since, ..}) => since.to_string(),
26942694
_=> "".to_string(),
26952695
},
26962696
reason: {
2697-
if let Some(ref depr) = self.depr {
2697+
if let Some(ref depr) = self.rustc_depr {
26982698
depr.reason.to_string()
26992699
} else if let attr::Unstable {reason: Some(ref reason), ..} = self.level {
27002700
reason.to_string()
@@ -2782,7 +2782,7 @@ impl<'tcx> Clean<Item> for ty::AssociatedType<'tcx> {
27822782
inner: AssociatedTypeItem(bounds, self.ty.clean(cx)),
27832783
visibility: self.vis.clean(cx),
27842784
def_id: self.def_id,
2785-
stability: stability::lookup(cx.tcx(), self.def_id).clean(cx),
2785+
stability: stability::lookup_stability(cx.tcx(), self.def_id).clean(cx),
27862786
}
27872787
}
27882788
}

visit_ast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> {
6464
fn stability(&self, id: ast::NodeId) -> Option<attr::Stability> {
6565
self.cx.tcx_opt().and_then(|tcx| {
6666
self.cx.map.opt_local_def_id(id)
67-
.and_then(|def_id| stability::lookup(tcx, def_id))
67+
.and_then(|def_id| stability::lookup_stability(tcx, def_id))
6868
.cloned()
6969
})
7070
}

0 commit comments

Comments
 (0)