]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0544.md
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0544.md
CommitLineData
94222f64
XL
1Multiple stability attributes were declared on the same item.
2
3Erroneous 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
11fn foo() {}
12```
13
14To 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!
21fn foo() {}
22```
23
24See the [How Rust is Made and “Nightly Rust”][how-rust-made-nightly] appendix
25of the Book and the [Stability attributes][stability-attributes] section of the
26Rustc 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