debug!("stability: \
inspecting def_id={:?} span={:?} of stability={:?}", def_id, span, stability);
- if let Some(&Stability{rustc_depr: Some(attr::RustcDeprecation { reason, .. }), ..})
+ if let Some(&Stability{rustc_depr: Some(attr::RustcDeprecation { reason, since }), ..})
= stability {
if let Some(id) = id {
- lint_deprecated(def_id, id, Some(reason));
+ if deprecation_in_effect(&since.as_str()) {
+ lint_deprecated(def_id, id, Some(reason));
+ }
}
}
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+
#![crate_name="lint_stability"]
#![crate_type = "lib"]
#![feature(staged_api)]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_text() {}
+#[stable(feature = "test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "99.99.99", reason = "text")]
+pub fn deprecated_future() {}
+
#[unstable(feature = "test_feature", issue = "0")]
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_unstable() {}
<Foo>::trait_deprecated_text(&foo);
<Foo as Trait>::trait_deprecated_text(&foo);
+ deprecated_future(); // Fine; no error.
+
deprecated_unstable();
//~^ ERROR use of unstable library feature
Trait::trait_deprecated_unstable(&foo);
#[rustc_deprecated(since = "1.0.0", reason = "text")]
pub fn deprecated_text() {}
+ #[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_deprecated(since = "99.99.99", reason = "text")]
+ pub fn deprecated_future() {}
+
#[unstable(feature = "test_feature", issue = "0")]
pub fn unstable() {}
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
<Foo>::trait_deprecated_text(&foo);
<Foo as Trait>::trait_deprecated_text(&foo);
+ deprecated_future();
+
unstable();
foo.method_unstable();
Foo::method_unstable(&foo);