2017-07-11 12:30:10 +00:00
|
|
|
// Testing gating of `#[stable]` in "weird" places.
|
|
|
|
//
|
|
|
|
// This file sits on its own because these signal errors, making
|
|
|
|
// this test incompatible with the "warnings only" nature of
|
|
|
|
// issue-43106-gating-of-builtin-attrs.rs
|
|
|
|
|
2019-01-01 23:21:05 +00:00
|
|
|
#![stable()]
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
|
|
|
|
2019-01-01 23:21:05 +00:00
|
|
|
#[stable()]
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
|
|
|
mod stable {
|
2019-01-01 23:21:05 +00:00
|
|
|
mod inner { #![stable()] }
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
|
|
|
|
2019-01-01 23:21:05 +00:00
|
|
|
#[stable()] fn f() { }
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
|
|
|
|
2019-01-01 23:21:05 +00:00
|
|
|
#[stable()] struct S;
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
2020-01-08 17:02:10 +00:00
|
|
|
//~| ERROR stability attributes may not be used outside of the standard library
|
2017-07-11 12:30:10 +00:00
|
|
|
|
2019-01-01 23:21:05 +00:00
|
|
|
#[stable()] type T = S;
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
|
|
|
|
2019-01-01 23:21:05 +00:00
|
|
|
#[stable()] impl S { }
|
2017-07-11 12:30:10 +00:00
|
|
|
//~^ ERROR stability attributes may not be used outside of the standard library
|
|
|
|
}
|
2018-03-12 20:21:43 +00:00
|
|
|
|
|
|
|
fn main() {}
|