]>
Commit | Line | Data |
---|---|---|
94222f64 XL |
1 | Multiple stability attributes were declared on the same item. |
2 | ||
3 | Erroneous code example: | |
4 | ||
5 | ```compile_fail,E0544 | |
6 | #![feature(staged_api)] | |
7 | #![stable(since = "1.0.0", feature = "rust1")] | |
8 | ||
9 | #[stable(feature = "rust1", since = "1.0.0")] | |
10 | #[stable(feature = "test", since = "2.0.0")] // invalid | |
11 | fn foo() {} | |
12 | ``` | |
13 | ||
14 | To fix this issue, ensure that each item has at most one stability attribute. | |
15 | ||
16 | ``` | |
17 | #![feature(staged_api)] | |
18 | #![stable(since = "1.0.0", feature = "rust1")] | |
19 | ||
20 | #[stable(feature = "test", since = "2.0.0")] // ok! | |
21 | fn foo() {} | |
22 | ``` | |
23 | ||
24 | See the [How Rust is Made and “Nightly Rust”][how-rust-made-nightly] appendix | |
25 | of the Book and the [Stability attributes][stability-attributes] section of the | |
26 | Rustc Dev Guide for more details. | |
27 | ||
28 | [how-rust-made-nightly]: https://doc.rust-lang.org/book/appendix-07-nightly-rust.html | |
29 | [stability-attributes]: https://rustc-dev-guide.rust-lang.org/stability.html |