2013-08-31 17:13:57 +10:00
|
|
|
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <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.
|
2014-10-14 23:05:01 -07:00
|
|
|
#![crate_name="lint_stability"]
|
2014-04-14 21:00:31 +05:30
|
|
|
#![crate_type = "lib"]
|
2015-01-21 18:21:14 -08:00
|
|
|
#![feature(staged_api)]
|
2015-01-07 15:48:16 -08:00
|
|
|
#![staged_api]
|
2013-08-31 17:13:57 +10:00
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn deprecated() {}
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn deprecated_text() {}
|
|
|
|
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn unstable() {}
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn unstable_text() {}
|
|
|
|
|
|
|
|
pub fn unmarked() {}
|
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn stable() {}
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn stable_text() {}
|
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub struct MethodTester;
|
|
|
|
|
|
|
|
impl MethodTester {
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn method_deprecated(&self) {}
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn method_deprecated_text(&self) {}
|
|
|
|
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn method_unstable(&self) {}
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn method_unstable_text(&self) {}
|
|
|
|
|
|
|
|
pub fn method_unmarked(&self) {}
|
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn method_stable(&self) {}
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub fn method_stable_text(&self) {}
|
|
|
|
|
|
|
|
#[locked]
|
|
|
|
pub fn method_locked(&self) {}
|
|
|
|
#[locked="text"]
|
|
|
|
pub fn method_locked_text(&self) {}
|
|
|
|
|
|
|
|
#[frozen]
|
|
|
|
pub fn method_frozen(&self) {}
|
|
|
|
#[frozen="text"]
|
|
|
|
pub fn method_frozen_text(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub trait Trait {
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
fn trait_deprecated(&self) {}
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
fn trait_deprecated_text(&self) {}
|
|
|
|
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2013-08-31 17:13:57 +10:00
|
|
|
fn trait_unstable(&self) {}
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
fn trait_unstable_text(&self) {}
|
|
|
|
|
|
|
|
fn trait_unmarked(&self) {}
|
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
fn trait_stable(&self) {}
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0", reason = "text")]
|
2013-08-31 17:13:57 +10:00
|
|
|
fn trait_stable_text(&self) {}
|
|
|
|
|
|
|
|
#[locked]
|
|
|
|
fn trait_locked(&self) {}
|
|
|
|
#[locked="text"]
|
|
|
|
fn trait_locked_text(&self) {}
|
|
|
|
|
|
|
|
#[frozen]
|
|
|
|
fn trait_frozen(&self) {}
|
|
|
|
#[frozen="text"]
|
|
|
|
fn trait_frozen_text(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Trait for MethodTester {}
|
|
|
|
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2015-01-12 18:40:19 -08:00
|
|
|
pub trait UnstableTrait {}
|
2014-11-05 15:49:37 -08:00
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2014-03-28 11:09:31 -07:00
|
|
|
pub struct DeprecatedStruct { pub i: int }
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2014-03-28 11:09:31 -07:00
|
|
|
pub struct UnstableStruct { pub i: int }
|
|
|
|
pub struct UnmarkedStruct { pub i: int }
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2014-03-28 11:09:31 -07:00
|
|
|
pub struct StableStruct { pub i: int }
|
2013-08-31 17:13:57 +10:00
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub struct DeprecatedUnitStruct;
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub struct UnstableUnitStruct;
|
|
|
|
pub struct UnmarkedUnitStruct;
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
pub struct StableUnitStruct;
|
|
|
|
|
|
|
|
pub enum Enum {
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
DeprecatedVariant,
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2013-08-31 17:13:57 +10:00
|
|
|
UnstableVariant,
|
|
|
|
|
|
|
|
UnmarkedVariant,
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2013-08-31 17:13:57 +10:00
|
|
|
StableVariant,
|
|
|
|
}
|
2014-01-30 23:36:05 +11:00
|
|
|
|
2015-01-12 18:40:19 -08:00
|
|
|
#[deprecated(feature = "oldstuff", since = "1.0.0")]
|
2014-03-31 19:01:01 -07:00
|
|
|
pub struct DeprecatedTupleStruct(pub int);
|
2015-01-22 18:22:03 -08:00
|
|
|
#[unstable(feature = "test_feature")]
|
2014-03-31 19:01:01 -07:00
|
|
|
pub struct UnstableTupleStruct(pub int);
|
|
|
|
pub struct UnmarkedTupleStruct(pub int);
|
2015-01-12 18:40:19 -08:00
|
|
|
#[stable(feature = "grandfathered", since = "1.0.0")]
|
2014-03-31 19:01:01 -07:00
|
|
|
pub struct StableTupleStruct(pub int);
|
2014-07-16 13:50:33 -07:00
|
|
|
|
|
|
|
#[macro_export]
|
2015-01-02 14:44:21 -08:00
|
|
|
macro_rules! macro_test {
|
2014-07-16 13:50:33 -07:00
|
|
|
() => (deprecated());
|
2015-01-02 14:44:21 -08:00
|
|
|
}
|
2014-09-18 00:15:36 +02:00
|
|
|
|
|
|
|
#[macro_export]
|
2015-01-02 14:44:21 -08:00
|
|
|
macro_rules! macro_test_arg {
|
2014-09-18 00:15:36 +02:00
|
|
|
($func:expr) => ($func);
|
2015-01-02 14:44:21 -08:00
|
|
|
}
|
2014-09-18 00:15:36 +02:00
|
|
|
|
|
|
|
#[macro_export]
|
2015-01-02 14:44:21 -08:00
|
|
|
macro_rules! macro_test_arg_nested {
|
2014-09-18 00:15:36 +02:00
|
|
|
($func:ident) => (macro_test_arg!($func()));
|
2015-01-02 14:44:21 -08:00
|
|
|
}
|