diff options
| author | bors <bors@rust-lang.org> | 2020-05-03 16:38:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-03 16:38:41 +0000 |
| commit | ea733c3a59be77b752d6d3f722596bfd5b1fcf31 (patch) | |
| tree | 61894abbcaaaf485a676ff25e81596bb79463299 /src/librustc_error_codes/error_codes | |
| parent | e5f35df2c6944b843b08369c4b2ff3bdb0beb2d2 (diff) | |
| parent | ce1dba99185a87eafcc99fc2738a1f8473f13b6e (diff) | |
| download | rust-ea733c3a59be77b752d6d3f722596bfd5b1fcf31.tar.gz rust-ea733c3a59be77b752d6d3f722596bfd5b1fcf31.zip | |
Auto merge of #71853 - Dylan-DPC:rollup-4qi6ry9, r=Dylan-DPC
Rollup of 4 pull requests Successful merges: - #71398 (Add `RefCell::take`) - #71663 (Fix exceeding bitshifts not emitting for assoc. consts (properly this time, I swear!)) - #71726 (Suggest deref when coercing `ty::Ref` to `ty::RawPtr` with arbitrary mutability) - #71808 (Add long error explanation for E0539) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0539.md | 48 |
1 files changed, 48 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..df2d7d910bb --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0539.md @@ -0,0 +1,48 @@ +An invalid meta-item was used inside an attribute. + +Erroneous code example: + +```compile_fail,E0539 +#![feature(staged_api)] +#![stable(since = "1.0.0", feature = "test")] + +#[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. + +``` +#![feature(staged_api)] +#![stable(since = "1.0.0", feature = "test")] + +#[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() {} +``` |
