Fix test/compile-fail
This commit is contained in:
parent
279fbaa29c
commit
895fcec3b4
25 changed files with 231 additions and 216 deletions
|
@ -66,7 +66,9 @@ impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
|
|||
|
||||
// Find a stability attribute (i.e. `#[stable (..)]`, `#[unstable (..)]`,
|
||||
// `#[rustc_const_unstable (..)]`).
|
||||
if stab_attrs.iter().any(|stab_attr| attr.check_name(stab_attr)) {
|
||||
if let Some(stab_attr) = stab_attrs.iter().find(|stab_attr| {
|
||||
attr.check_name(stab_attr)
|
||||
}) {
|
||||
let meta_item = attr.meta();
|
||||
if let Some(MetaItem { node: MetaItemKind::List(ref metas), .. }) = meta_item {
|
||||
let mut feature = None;
|
||||
|
@ -82,7 +84,12 @@ impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
if let Some(feature) = feature {
|
||||
features.push((feature, since, attr.span));
|
||||
// This additional check for stability is to make sure we
|
||||
// don't emit additional, irrelevant errors for malformed
|
||||
// attributes.
|
||||
if *stab_attr != "stable" || since.is_some() {
|
||||
features.push((feature, since, attr.span));
|
||||
}
|
||||
}
|
||||
// We need to iterate over the other attributes, because
|
||||
// `rustc_const_unstable` is not mutually exclusive with
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
#![crate_name="inherited_stability"]
|
||||
#![crate_type = "lib"]
|
||||
#![unstable(feature = "test_feature", issue = "0")]
|
||||
#![unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#![feature(staged_api)]
|
||||
|
||||
pub fn unstable() {}
|
||||
|
@ -19,16 +19,16 @@ pub fn stable() {}
|
|||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub mod stable_mod {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn unstable() {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub fn stable() {}
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub mod unstable_mod {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated() {}
|
||||
|
||||
|
@ -37,7 +37,7 @@ pub mod unstable_mod {
|
|||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub trait Stable {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
fn unstable(&self);
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
|
|
@ -11,20 +11,20 @@
|
|||
#![crate_name="lint_output_format"]
|
||||
#![crate_type = "lib"]
|
||||
#![feature(staged_api)]
|
||||
#![unstable(feature = "test_feature", issue = "0")]
|
||||
#![unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn foo() -> usize {
|
||||
20
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn bar() -> usize {
|
||||
40
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn baz() -> usize {
|
||||
30
|
||||
}
|
||||
|
|
|
@ -14,27 +14,27 @@
|
|||
#![feature(associated_type_defaults)]
|
||||
#![stable(feature = "lint_stability", since = "1.0.0")]
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated() {}
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated_text() {}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "99.99.99", reason = "text")]
|
||||
pub fn deprecated_future() {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated_unstable() {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated_unstable_text() {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn unstable() {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn unstable_text() {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -46,23 +46,23 @@ pub fn stable_text() {}
|
|||
pub struct MethodTester;
|
||||
|
||||
impl MethodTester {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated(&self) {}
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated_unstable_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn method_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn method_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -71,25 +71,25 @@ impl MethodTester {
|
|||
pub fn method_stable_text(&self) {}
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
pub trait Trait {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated(&self) {}
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated_unstable_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
fn trait_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
fn trait_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -98,100 +98,100 @@ pub trait Trait {
|
|||
fn trait_stable_text(&self) {}
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
pub trait TraitWithAssociatedTypes {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
type TypeUnstable = u8;
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
type TypeDeprecated = u8;
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
impl Trait for MethodTester {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub trait UnstableTrait { fn dummy(&self) { } }
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub trait DeprecatedTrait {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] fn dummy(&self) { }
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
|
||||
}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnstableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
|
||||
}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] pub i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
|
||||
}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub enum UnstableEnum {}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub enum StableEnum {}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnitStruct;
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnstableUnitStruct;
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableUnitStruct;
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableUnitStruct;
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
pub enum Enum {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
DeprecatedVariant,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
DeprecatedUnstableVariant,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
UnstableVariant,
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
StableVariant,
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[macro_export]
|
||||
macro_rules! macro_test {
|
||||
() => (deprecated());
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[macro_export]
|
||||
macro_rules! macro_test_arg {
|
||||
($func:expr) => ($func);
|
||||
}
|
||||
|
||||
#[stable(feature = "test_feature", since = "1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
#[macro_export]
|
||||
macro_rules! macro_test_arg_nested {
|
||||
($func:ident) => (macro_test_arg!($func()));
|
||||
|
|
|
@ -15,47 +15,47 @@
|
|||
pub struct Stable {
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub inherit: u8, // it's a lie (stable doesn't inherit)
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub override1: u8,
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub override2: u8,
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct Stable2(#[stable(feature = "rust1", since = "1.0.0")] pub u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")] pub u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")] pub u8,
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8);
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct Unstable {
|
||||
pub inherit: u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub override1: u8,
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub override2: u8,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct Unstable2(pub u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] pub u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")] pub u8);
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct Deprecated {
|
||||
pub inherit: u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub override1: u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub override2: u8,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct Deprecated2(pub u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] pub u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")] pub u8);
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")] pub u8);
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![feature(staged_api)]
|
||||
#![stable(feature = "foo", since = "1.2.0")]
|
||||
#![stable(feature = "stable_test_feature", since = "1.2.0")]
|
||||
|
||||
|
||||
#[unstable(feature = "foo", issue = "1")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "1")]
|
||||
pub fn unstable() {}
|
||||
|
||||
#[unstable(feature = "foo", reason = "message", issue = "2")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "message", issue = "2")]
|
||||
pub fn unstable_msg() {}
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
// compile-flags:--cfg foo
|
||||
|
||||
#![cfg_attr(foo, unstable(feature = "test_feature", issue = "0"))]
|
||||
#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))]
|
||||
#![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))]
|
||||
#![feature(staged_api)]
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(staged_api)]
|
||||
|
||||
#![stable(feature = "test_feature", since = "1.0.0")]
|
||||
#![stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
|
||||
#[deprecated]
|
||||
fn main() { } //~ERROR `#[deprecated]` cannot be used in staged api
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
// aux-build:stability_cfg2.rs
|
||||
|
||||
#![feature(test_feature)]
|
||||
#![feature(unstable_test_feature)]
|
||||
#![deny(non_snake_case)] // To trigger a hard error
|
||||
|
||||
// Shouldn't generate a warning about unstable features
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
|
||||
extern crate lint_stability;
|
||||
|
||||
use lint_stability::{unstable, deprecated}; //~ ERROR use of unstable library feature 'test_feature'
|
||||
use lint_stability::{unstable, deprecated};
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature'
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
|
||||
extern crate lint_stability;
|
||||
|
||||
use lint_stability::UnstableEnum::{}; //~ ERROR use of unstable library feature 'test_feature'
|
||||
use lint_stability::UnstableEnum::{};
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature'
|
||||
use lint_stability::StableEnum::{}; // OK
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags:-D unknown_features
|
||||
// compile-flags:-D bare_trait_object
|
||||
|
||||
// error-pattern:lint `unknown_features` has been renamed to `unused_features`
|
||||
// error-pattern:requested on the command line with `-D unknown_features`
|
||||
// error-pattern:lint `bare_trait_object` has been renamed to `bare_trait_objects`
|
||||
// error-pattern:requested on the command line with `-D bare_trait_object`
|
||||
// error-pattern:unused
|
||||
|
||||
#[deny(unused)]
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[deny(unknown_features)] //~ WARN lint `unknown_features` has been renamed to `unused_features`
|
||||
#[deny(bare_trait_object)]
|
||||
//~^ WARN lint `bare_trait_object` has been renamed to `bare_trait_objects`
|
||||
#[deny(unused)]
|
||||
fn main() { let unused = (); } //~ ERROR unused
|
||||
|
|
|
@ -76,15 +76,15 @@ mod cross_crate {
|
|||
<Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
|
||||
|
||||
foo.method_unstable_text();
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
Foo::method_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
<Foo>::method_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
foo.trait_unstable_text();
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
<Foo>::trait_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
|
||||
stable();
|
||||
foo.method_stable();
|
||||
|
@ -149,9 +149,9 @@ mod cross_crate {
|
|||
foo.trait_unstable(); //~ ERROR use of unstable library feature
|
||||
<Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature
|
||||
foo.trait_unstable_text();
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
<Foo>::trait_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
foo.trait_stable();
|
||||
Trait::trait_stable(&foo);
|
||||
<Foo>::trait_stable(&foo);
|
||||
|
@ -167,7 +167,7 @@ mod cross_crate {
|
|||
//~^ ERROR use of unstable library feature
|
||||
foo.trait_unstable(); //~ ERROR use of unstable library feature
|
||||
foo.trait_unstable_text();
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
foo.trait_stable();
|
||||
}
|
||||
|
||||
|
@ -178,16 +178,16 @@ mod cross_crate {
|
|||
}
|
||||
|
||||
mod this_crate {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated() {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated_text() {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn unstable() {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn unstable_text() {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -199,16 +199,16 @@ mod this_crate {
|
|||
pub struct MethodTester;
|
||||
|
||||
impl MethodTester {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn method_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn method_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -218,16 +218,16 @@ mod this_crate {
|
|||
}
|
||||
|
||||
pub trait Trait {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
fn trait_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
fn trait_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -238,43 +238,43 @@ mod this_crate {
|
|||
|
||||
impl Trait for MethodTester {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnitStruct;
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableUnitStruct;
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableUnitStruct;
|
||||
|
||||
pub enum Enum {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
DeprecatedVariant,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
UnstableVariant,
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
StableVariant,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedTupleStruct(isize);
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableTupleStruct(isize);
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableTupleStruct(isize);
|
||||
|
@ -391,7 +391,7 @@ mod this_crate {
|
|||
foo.trait_stable();
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn test_fn_body() {
|
||||
fn fn_in_body() {}
|
||||
|
@ -399,7 +399,7 @@ mod this_crate {
|
|||
}
|
||||
|
||||
impl MethodTester {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn test_method_body(&self) {
|
||||
fn fn_in_body() {}
|
||||
|
@ -407,7 +407,7 @@ mod this_crate {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub trait DeprecatedTrait {
|
||||
fn dummy(&self) { }
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#![warn(deprecated)]
|
||||
#![allow(dead_code, unused_extern_crates)]
|
||||
#![feature(staged_api, test_feature, rustc_attrs)]
|
||||
#![feature(staged_api, unstable_test_feature, rustc_attrs)]
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
|
@ -227,16 +227,16 @@ mod inheritance {
|
|||
}
|
||||
|
||||
mod this_crate {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated() {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated_text() {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn unstable() {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn unstable_text() {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -248,16 +248,16 @@ mod this_crate {
|
|||
pub struct MethodTester;
|
||||
|
||||
impl MethodTester {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn method_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn method_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -267,16 +267,16 @@ mod this_crate {
|
|||
}
|
||||
|
||||
pub trait Trait {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
fn trait_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
fn trait_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -287,43 +287,43 @@ mod this_crate {
|
|||
|
||||
impl Trait for MethodTester {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnitStruct;
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableUnitStruct;
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableUnitStruct;
|
||||
|
||||
pub enum Enum {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
DeprecatedVariant,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
UnstableVariant,
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
StableVariant,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedTupleStruct(isize);
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableTupleStruct(isize);
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableTupleStruct(isize);
|
||||
|
@ -441,7 +441,7 @@ mod this_crate {
|
|||
foo.trait_stable();
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn test_fn_body() {
|
||||
fn fn_in_body() {}
|
||||
|
@ -449,7 +449,7 @@ mod this_crate {
|
|||
}
|
||||
|
||||
impl MethodTester {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn test_method_body(&self) {
|
||||
fn fn_in_body() {}
|
||||
|
@ -457,7 +457,7 @@ mod this_crate {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub trait DeprecatedTrait {
|
||||
fn dummy(&self) { }
|
||||
|
|
|
@ -9,9 +9,10 @@
|
|||
// except according to those terms.
|
||||
|
||||
// aux-build:lint_stability_fields.rs
|
||||
|
||||
#![deny(deprecated)]
|
||||
#![allow(dead_code)]
|
||||
#![feature(staged_api, test_feature)]
|
||||
#![feature(staged_api, unstable_test_feature)]
|
||||
|
||||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
|
@ -162,50 +163,50 @@ mod this_crate {
|
|||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
struct Stable {
|
||||
inherit: u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override1: u8,
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override2: u8,
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
struct Stable2(u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
struct Unstable {
|
||||
inherit: u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
override1: u8,
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override2: u8,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
struct Unstable2(u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
struct Deprecated {
|
||||
inherit: u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
override1: u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override2: u8,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
struct Deprecated2(u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")] u8);
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")] u8);
|
||||
|
||||
pub fn foo() {
|
||||
let x = Stable {
|
||||
|
|
|
@ -138,50 +138,50 @@ mod this_crate {
|
|||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
struct Stable {
|
||||
inherit: u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override1: u8,
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override2: u8,
|
||||
}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
struct Stable2(u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
struct Unstable {
|
||||
inherit: u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
override1: u8,
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override2: u8,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
struct Unstable2(u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
struct Deprecated {
|
||||
inherit: u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
override1: u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
override2: u8,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
struct Deprecated2(u8,
|
||||
#[stable(feature = "rust1", since = "1.0.0")] u8,
|
||||
#[unstable(feature = "test_feature", issue = "0")] u8);
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")] u8);
|
||||
|
||||
pub fn foo() {
|
||||
let x = Stable {
|
||||
|
|
|
@ -71,11 +71,11 @@ mod cross_crate {
|
|||
<Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
|
||||
|
||||
unstable_text();
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
Trait::trait_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
<Foo as Trait>::trait_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
|
||||
stable();
|
||||
foo.method_stable();
|
||||
|
@ -162,9 +162,9 @@ mod cross_crate {
|
|||
Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature
|
||||
<Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature
|
||||
Trait::trait_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
<Foo as Trait>::trait_unstable_text(&foo);
|
||||
//~^ ERROR use of unstable library feature 'test_feature': text
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': text
|
||||
foo.trait_stable();
|
||||
Trait::trait_stable(&foo);
|
||||
<Foo>::trait_stable(&foo);
|
||||
|
@ -213,10 +213,10 @@ mod inheritance {
|
|||
}
|
||||
|
||||
mod this_crate {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated() {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn deprecated_text() {}
|
||||
|
||||
|
@ -224,9 +224,9 @@ mod this_crate {
|
|||
#[rustc_deprecated(since = "99.99.99", reason = "text")]
|
||||
pub fn deprecated_future() {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn unstable() {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn unstable_text() {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -238,16 +238,16 @@ mod this_crate {
|
|||
pub struct MethodTester;
|
||||
|
||||
impl MethodTester {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub fn method_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub fn method_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
pub fn method_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -257,16 +257,16 @@ mod this_crate {
|
|||
}
|
||||
|
||||
pub trait Trait {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated(&self) {}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn trait_deprecated_text(&self) {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
fn trait_unstable(&self) {}
|
||||
#[unstable(feature = "test_feature", reason = "text", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
|
||||
fn trait_unstable_text(&self) {}
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
|
@ -277,43 +277,43 @@ mod this_crate {
|
|||
|
||||
impl Trait for MethodTester {}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableStruct {
|
||||
#[stable(feature = "test_feature", since = "1.0.0")] i: isize
|
||||
#[stable(feature = "stable_test_feature", since = "1.0.0")] i: isize
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedUnitStruct;
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableUnitStruct;
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableUnitStruct;
|
||||
|
||||
pub enum Enum {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
DeprecatedVariant,
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
UnstableVariant,
|
||||
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
StableVariant,
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub struct DeprecatedTupleStruct(isize);
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub struct UnstableTupleStruct(isize);
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
pub struct StableTupleStruct(isize);
|
||||
|
@ -432,7 +432,7 @@ mod this_crate {
|
|||
foo.trait_stable();
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn test_fn_body() {
|
||||
fn fn_in_body() {}
|
||||
|
@ -440,7 +440,7 @@ mod this_crate {
|
|||
}
|
||||
|
||||
impl MethodTester {
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
fn test_method_body(&self) {
|
||||
fn fn_in_body() {}
|
||||
|
@ -448,7 +448,7 @@ mod this_crate {
|
|||
}
|
||||
}
|
||||
|
||||
#[unstable(feature = "test_feature", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
#[rustc_deprecated(since = "1.0.0", reason = "text")]
|
||||
pub trait DeprecatedTrait {
|
||||
fn dummy(&self) { }
|
||||
|
|
|
@ -13,20 +13,20 @@
|
|||
#![crate_type="lib"]
|
||||
#![feature(staged_api)]
|
||||
|
||||
#![stable(feature = "test_feature", since = "1.0.0")]
|
||||
#![stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
|
||||
pub fn unmarked() {
|
||||
//~^ ERROR This node does not have a stability attribute
|
||||
()
|
||||
}
|
||||
|
||||
#[unstable(feature = "foo", issue = "0")]
|
||||
#[unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
pub mod foo {
|
||||
// #[unstable] is inherited
|
||||
pub fn unmarked() {}
|
||||
}
|
||||
|
||||
#[stable(feature = "bar", since="1.0.0")]
|
||||
#[stable(feature = "stable_test_feature", since="1.0.0")]
|
||||
pub mod bar {
|
||||
// #[stable] is not inherited
|
||||
pub fn unmarked() {}
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// aux-build:stability_attribute_issue.rs
|
||||
// ignore-tidy-linelength
|
||||
|
||||
#![deny(deprecated)]
|
||||
|
||||
|
@ -16,6 +17,8 @@ extern crate stability_attribute_issue;
|
|||
use stability_attribute_issue::*;
|
||||
|
||||
fn main() {
|
||||
unstable(); //~ ERROR use of unstable library feature 'foo' (see issue #1)
|
||||
unstable_msg(); //~ ERROR use of unstable library feature 'foo': message (see issue #2)
|
||||
unstable();
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature' (see issue #1)
|
||||
unstable_msg();
|
||||
//~^ ERROR use of unstable library feature 'unstable_test_feature': message (see issue #2)
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(staged_api)]
|
||||
|
||||
#![stable(feature = "test_feature", since = "1.0.0")]
|
||||
#![stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
|
||||
#[stable(feature = "a", feature = "b", since = "1.0.0")] //~ ERROR multiple 'feature' items
|
||||
fn f1() { }
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#![feature(staged_api)]
|
||||
|
||||
#![stable(feature = "test_feature", since = "1.0.0")]
|
||||
#![stable(feature = "stable_test_feature", since = "1.0.0")]
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! mac { //~ ERROR This node does not have a stability attribute
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#![stable(feature = "rust1", since = "1.0.0")]
|
||||
|
||||
mod bogus_attribute_types_1 {
|
||||
#[stable(feature = "a", since = "a", reason)] //~ ERROR unknown meta item 'reason' [E0541]
|
||||
#[stable(feature = "a", since = "b", reason)] //~ ERROR unknown meta item 'reason' [E0541]
|
||||
fn f1() { }
|
||||
|
||||
#[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539]
|
||||
|
@ -35,7 +35,7 @@ mod bogus_attribute_types_2 {
|
|||
#[unstable] //~ ERROR incorrect stability attribute type [E0548]
|
||||
fn f1() { }
|
||||
|
||||
#[unstable = "a"] //~ ERROR incorrect stability attribute type [E0548]
|
||||
#[unstable = "b"] //~ ERROR incorrect stability attribute type [E0548]
|
||||
fn f2() { }
|
||||
|
||||
#[stable] //~ ERROR incorrect stability attribute type [E0548]
|
||||
|
@ -57,7 +57,7 @@ mod missing_feature_names {
|
|||
#[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546]
|
||||
fn f1() { }
|
||||
|
||||
#[unstable(feature = "a")] //~ ERROR missing 'issue' [E0547]
|
||||
#[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547]
|
||||
fn f2() { }
|
||||
|
||||
#[stable(since = "a")] //~ ERROR missing 'feature' [E0546]
|
||||
|
@ -73,12 +73,12 @@ mod missing_version {
|
|||
fn f2() { }
|
||||
}
|
||||
|
||||
#[unstable(feature = "a", issue = "0")]
|
||||
#[unstable(feature = "b", issue = "0")]
|
||||
#[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544]
|
||||
fn multiple1() { }
|
||||
|
||||
#[unstable(feature = "a", issue = "0")]
|
||||
#[unstable(feature = "a", issue = "0")] //~ ERROR multiple stability levels [E0544]
|
||||
#[unstable(feature = "b", issue = "0")]
|
||||
#[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544]
|
||||
fn multiple2() { }
|
||||
|
||||
#[stable(feature = "a", since = "b")]
|
||||
|
@ -88,8 +88,8 @@ fn multiple3() { }
|
|||
#[stable(feature = "a", since = "b")]
|
||||
#[rustc_deprecated(since = "b", reason = "text")]
|
||||
#[rustc_deprecated(since = "b", reason = "text")]
|
||||
#[rustc_const_unstable(feature = "a")]
|
||||
#[rustc_const_unstable(feature = "b")]
|
||||
#[rustc_const_unstable(feature = "c")]
|
||||
#[rustc_const_unstable(feature = "d")]
|
||||
pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540]
|
||||
//~^ ERROR Invalid stability or deprecation version found
|
||||
//~| ERROR multiple rustc_const_unstable attributes
|
||||
|
|
|
@ -13,10 +13,11 @@
|
|||
|
||||
#![deny(stable_features)]
|
||||
|
||||
#![feature(test_accepted_feature)] //~ ERROR this feature has been stable since 1.0.0
|
||||
#![feature(test_accepted_feature)]
|
||||
//~^ ERROR the feature `test_accepted_feature` has been stable since 1.0.0
|
||||
|
||||
// FIXME(#44232) we should error that this isn't used.
|
||||
#![feature(rust1)]
|
||||
//~^ ERROR the feature `rust1` has been stable since 1.0.0
|
||||
|
||||
fn main() {
|
||||
let _foo: Vec<()> = Vec::new();
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
#![crate_type = "lib"]
|
||||
#![feature(staged_api)]
|
||||
#![unstable(feature = "test_feature", issue = "0")]
|
||||
#![unstable(feature = "unstable_test_feature", issue = "0")]
|
||||
|
||||
pub fn baz() { }
|
||||
|
|
Loading…
Add table
Reference in a new issue