diff options
| author | unexge <unexge@gmail.com> | 2020-05-02 21:14:08 +0300 |
|---|---|---|
| committer | unexge <unexge@gmail.com> | 2020-05-02 21:14:08 +0300 |
| commit | e4ee172ab05b03bf71e0d89e0042a89ff26a3c29 (patch) | |
| tree | 0b04847c5b06f1a4447a5976f0331bc57216e349 /src/librustc_error_codes/error_codes | |
| parent | 7184d137f65bb8d143ce8b5b664e50d33c4b5fbd (diff) | |
| download | rust-e4ee172ab05b03bf71e0d89e0042a89ff26a3c29.tar.gz rust-e4ee172ab05b03bf71e0d89e0042a89ff26a3c29.zip | |
Add long error explanation for E0539
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0539.md | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/librustc_error_codes/error_codes/E0539.md b/src/librustc_error_codes/error_codes/E0539.md new file mode 100644 index 00000000000..69555453514 --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0539.md @@ -0,0 +1,42 @@ +An invalid meta-item was used inside an attribute. + +Erroneous code example: + +```compile_fail,E0539 +#[rustc_deprecated(reason)] // error! +#[unstable(feature = "deprecated_fn", issue = "123")] +fn deprecated() {} + +#[unstable(feature = "unstable_struct", issue)] // error! +struct Unstable; + +#[rustc_const_unstable(feature)] // error! +const fn unstable_fn() {} + +#[stable(feature = "stable_struct", since)] // error! +struct Stable; + +#[rustc_const_stable(feature)] // error! +const fn stable_fn() {} +``` + +Meta items are the key-value pairs inside of an attribute. +To fix these issues you need to give required key-value pairs. + +``` +#[rustc_deprecated(since = "1.39.0", reason = "reason")] // ok! +#[unstable(feature = "deprecated_fn", issue = "123")] +fn deprecated() {} + +#[unstable(feature = "unstable_struct", issue = "123")] // ok! +struct Unstable; + +#[rustc_const_unstable(feature = "unstable_fn", issue = "124")] // ok! +const fn unstable_fn() {} + +#[stable(feature = "stable_struct", since = "1.39.0")] // ok! +struct Stable; + +#[rustc_const_stable(feature = "stable_fn", since = "1.39.0")] // ok! +const fn stable_fn() {} +``` |
