This commit is contained in:
Manish Goregaokar 2015-02-04 03:20:12 +05:30
parent d02d4c3c9b
commit f5e5bdb197
2 changed files with 4 additions and 41 deletions

View File

@ -11,6 +11,7 @@
#![crate_type = "lib"]
#![feature(staged_api)]
#![staged_api]
#![stable(feature = "lint_stability", since = "1.0.0")]
#[stable(feature = "test_feature", since = "1.0.0")]
#[deprecated(since = "1.0.0")]
@ -31,8 +32,6 @@ pub fn unstable() {}
#[unstable(feature = "test_feature", reason = "text")]
pub fn unstable_text() {}
pub fn unmarked() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stable() {}
#[stable(feature = "rust1", since = "1.0.0", reason = "text")]
@ -61,8 +60,6 @@ impl MethodTester {
#[unstable(feature = "test_feature", reason = "text")]
pub fn method_unstable_text(&self) {}
pub fn method_unmarked(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn method_stable(&self) {}
#[stable(feature = "rust1", since = "1.0.0", reason = "text")]
@ -79,6 +76,7 @@ impl MethodTester {
pub fn method_frozen_text(&self) {}
}
#[stable(feature = "test_feature", since = "1.0.0")]
pub trait Trait {
#[stable(feature = "test_feature", since = "1.0.0")]
#[deprecated(since = "1.0.0")]
@ -99,8 +97,6 @@ pub trait Trait {
#[unstable(feature = "test_feature", reason = "text")]
fn trait_unstable_text(&self) {}
fn trait_unmarked(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
fn trait_stable(&self) {}
#[stable(feature = "rust1", since = "1.0.0", reason = "text")]
@ -130,7 +126,6 @@ pub struct DeprecatedStruct { pub i: int }
pub struct DeprecatedUnstableStruct { pub i: int }
#[unstable(feature = "test_feature")]
pub struct UnstableStruct { pub i: int }
pub struct UnmarkedStruct { pub i: int }
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct { pub i: int }
@ -142,10 +137,10 @@ pub struct DeprecatedUnitStruct;
pub struct DeprecatedUnstableUnitStruct;
#[unstable(feature = "test_feature")]
pub struct UnstableUnitStruct;
pub struct UnmarkedUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
#[stable(feature = "test_feature", since = "1.0.0")]
pub enum Enum {
#[stable(feature = "test_feature", since = "1.0.0")]
#[deprecated(since = "1.0.0")]
@ -156,7 +151,6 @@ pub enum Enum {
#[unstable(feature = "test_feature")]
UnstableVariant,
UnmarkedVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
@ -169,7 +163,6 @@ pub struct DeprecatedTupleStruct(pub int);
pub struct DeprecatedUnstableTupleStruct(pub int);
#[unstable(feature = "test_feature")]
pub struct UnstableTupleStruct(pub int);
pub struct UnmarkedTupleStruct(pub int);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(pub int);

View File

@ -20,7 +20,7 @@
#![staged_api]
#[macro_use]
extern crate lint_stability; //~ ERROR: use of unmarked library feature
extern crate lint_stability;
mod cross_crate {
extern crate stability_cfg1;
@ -61,10 +61,6 @@ mod cross_crate {
foo.method_unstable_text(); //~ WARNING use of unstable library feature 'test_feature': text
foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'test_feature': text
unmarked(); //~ ERROR use of unmarked library feature
foo.method_unmarked(); //~ ERROR use of unmarked library feature
foo.trait_unmarked(); //~ ERROR use of unmarked library feature
stable();
foo.method_stable();
foo.trait_stable();
@ -77,28 +73,24 @@ mod cross_crate {
let _ = DeprecatedUnstableStruct { i: 0 }; //~ ERROR use of deprecated item
//~^ WARNING use of unstable library feature
let _ = UnstableStruct { i: 0 }; //~ WARNING use of unstable library feature
let _ = UnmarkedStruct { i: 0 }; //~ ERROR use of unmarked library feature
let _ = StableStruct { i: 0 };
let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item
let _ = DeprecatedUnstableUnitStruct; //~ ERROR use of deprecated item
//~^ WARNING use of unstable library feature
let _ = UnstableUnitStruct; //~ WARNING use of unstable library feature
let _ = UnmarkedUnitStruct; //~ ERROR use of unmarked library feature
let _ = StableUnitStruct;
let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item
let _ = Enum::DeprecatedUnstableVariant; //~ ERROR use of deprecated item
//~^ WARNING use of unstable library feature
let _ = Enum::UnstableVariant; //~ WARNING use of unstable library feature
let _ = Enum::UnmarkedVariant; //~ ERROR use of unmarked library feature
let _ = Enum::StableVariant;
let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item
let _ = DeprecatedUnstableTupleStruct (1); //~ ERROR use of deprecated item
//~^ WARNING use of unstable library feature
let _ = UnstableTupleStruct (1); //~ WARNING use of unstable library feature
let _ = UnmarkedTupleStruct (1); //~ ERROR use of unmarked library feature
let _ = StableTupleStruct (1);
// At the moment, the lint checker only checks stability in
@ -123,7 +115,6 @@ mod cross_crate {
//~^ WARNING use of unstable library feature
foo.trait_unstable(); //~ WARNING use of unstable library feature
foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'test_feature': text
foo.trait_unmarked(); //~ ERROR use of unmarked library feature
foo.trait_stable();
}
@ -136,7 +127,6 @@ mod cross_crate {
//~^ WARNING use of unstable library feature
foo.trait_unstable(); //~ WARNING use of unstable library feature
foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'test_feature': text
foo.trait_unmarked(); //~ ERROR use of unmarked library feature
foo.trait_stable();
}
@ -183,8 +173,6 @@ mod this_crate {
#[unstable(feature = "test_feature", reason = "text")]
pub fn unstable_text() {}
pub fn unmarked() {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn stable() {}
#[stable(feature = "rust1", since = "1.0.0", reason = "text")]
@ -206,8 +194,6 @@ mod this_crate {
#[unstable(feature = "test_feature", reason = "text")]
pub fn method_unstable_text(&self) {}
pub fn method_unmarked(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
pub fn method_stable(&self) {}
#[stable(feature = "rust1", since = "1.0.0", reason = "text")]
@ -227,8 +213,6 @@ mod this_crate {
#[unstable(feature = "test_feature", reason = "text")]
fn trait_unstable_text(&self) {}
fn trait_unmarked(&self) {}
#[stable(feature = "rust1", since = "1.0.0")]
fn trait_stable(&self) {}
#[stable(feature = "rust1", since = "1.0.0", reason = "text")]
@ -242,7 +226,6 @@ mod this_crate {
pub struct DeprecatedStruct { i: isize }
#[unstable(feature = "test_feature")]
pub struct UnstableStruct { i: isize }
pub struct UnmarkedStruct { i: isize }
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableStruct { i: isize }
@ -251,7 +234,6 @@ mod this_crate {
pub struct DeprecatedUnitStruct;
#[unstable(feature = "test_feature")]
pub struct UnstableUnitStruct;
pub struct UnmarkedUnitStruct;
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableUnitStruct;
@ -262,7 +244,6 @@ mod this_crate {
#[unstable(feature = "test_feature")]
UnstableVariant,
UnmarkedVariant,
#[stable(feature = "rust1", since = "1.0.0")]
StableVariant,
}
@ -272,7 +253,6 @@ mod this_crate {
pub struct DeprecatedTupleStruct(isize);
#[unstable(feature = "test_feature")]
pub struct UnstableTupleStruct(isize);
pub struct UnmarkedTupleStruct(isize);
#[stable(feature = "rust1", since = "1.0.0")]
pub struct StableTupleStruct(isize);
@ -299,10 +279,6 @@ mod this_crate {
foo.method_unstable_text();
foo.trait_unstable_text();
unmarked();
foo.method_unmarked();
foo.trait_unmarked();
stable();
foo.method_stable();
foo.trait_stable();
@ -313,22 +289,18 @@ mod this_crate {
let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
let _ = UnstableStruct { i: 0 };
let _ = UnmarkedStruct { i: 0 };
let _ = StableStruct { i: 0 };
let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item
let _ = UnstableUnitStruct;
let _ = UnmarkedUnitStruct;
let _ = StableUnitStruct;
let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item
let _ = Enum::UnstableVariant;
let _ = Enum::UnmarkedVariant;
let _ = Enum::StableVariant;
let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item
let _ = UnstableTupleStruct (1);
let _ = UnmarkedTupleStruct (1);
let _ = StableTupleStruct (1);
}
@ -337,7 +309,6 @@ mod this_crate {
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
foo.trait_unstable();
foo.trait_unstable_text();
foo.trait_unmarked();
foo.trait_stable();
}
@ -346,7 +317,6 @@ mod this_crate {
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
foo.trait_unstable();
foo.trait_unstable_text();
foo.trait_unmarked();
foo.trait_stable();
}