if self.tcx.features().staged_api {
// This crate explicitly wants staged API.
debug!("annotate(id = {:?}, attrs = {:?})", id, attrs);
- if let Some(..) = attr::find_deprecation(self.tcx.sess.diagnostic(), attrs, item_sp) {
+ if let Some(..) = attr::find_deprecation(&self.tcx.sess.parse_sess, attrs, item_sp) {
self.tcx.sess.span_err(item_sp, "`#[deprecated]` cannot be used in staged api, \
use `#[rustc_deprecated]` instead");
}
- if let Some(mut stab) = attr::find_stability(self.tcx.sess.diagnostic(),
+ if let Some(mut stab) = attr::find_stability(&self.tcx.sess.parse_sess,
attrs, item_sp) {
// Error if prohibited, or can't inherit anything from a container
if kind == AnnotationKind::Prohibited ||
if let (&Some(attr::RustcDeprecation {since: dep_since, ..}),
&attr::Stable {since: stab_since}) = (&stab.rustc_depr, &stab.level) {
// Explicit version of iter::order::lt to handle parse errors properly
- for (dep_v, stab_v) in
- dep_since.as_str().split('.').zip(stab_since.as_str().split('.')) {
+ for (dep_v, stab_v) in dep_since.as_str()
+ .split('.')
+ .zip(stab_since.as_str().split('.'))
+ {
if let (Ok(dep_v), Ok(stab_v)) = (dep_v.parse::<u64>(), stab_v.parse()) {
match dep_v.cmp(&stab_v) {
Ordering::Less => {
}
}
- if let Some(depr) = attr::find_deprecation(self.tcx.sess.diagnostic(), attrs, item_sp) {
+ if let Some(depr) = attr::find_deprecation(&self.tcx.sess.parse_sess, attrs, item_sp) {
if kind == AnnotationKind::Prohibited {
self.tcx.sess.span_err(item_sp, "This deprecation annotation is useless");
}
feature: Symbol::intern("rustc_private"),
rustc_depr: None,
const_stability: None,
+ promotable: false,
});
annotator.parent_stab = Some(stability);
}
Some(Def::Method(_)) |
Some(Def::AssociatedTy(_)) |
Some(Def::AssociatedConst(_)) => {
- match self.associated_item(def_id).container {
- ty::TraitContainer(trait_def_id) => {
- // Trait methods do not declare visibility (even
- // for visibility info in cstore). Use containing
- // trait instead, so methods of pub traits are
- // themselves considered pub.
- def_id = trait_def_id;
- }
- _ => {}
+ if let ty::TraitContainer(trait_def_id) = self.associated_item(def_id).container {
+ // Trait methods do not declare visibility (even
+ // for visibility info in cstore). Use containing
+ // trait instead, so methods of pub traits are
+ // themselves considered pub.
+ def_id = trait_def_id;
}
}
_ => {}
/// `id`.
pub fn eval_stability(self, def_id: DefId, id: Option<NodeId>, span: Span) -> EvalResult {
if span.allows_unstable() {
- debug!("stability: \
- skipping span={:?} since it is internal", span);
+ debug!("stability: skipping span={:?} since it is internal", span);
return EvalResult::Allow;
}
let param_env = self.tcx.param_env(def_id);
if !param_env.can_type_implement_copy(self.tcx, ty).is_ok() {
emit_feature_err(&self.tcx.sess.parse_sess,
- "untagged_unions", item.span, GateIssue::Language,
- "unions with non-`Copy` fields are unstable");
+ "untagged_unions", item.span, GateIssue::Language,
+ "unions with non-`Copy` fields are unstable");
}
}
}