-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #71808 - unexge:long-err-expl-for-e0539, r=GuillaumeG…
…omez Add long error explanation for E0539 since this error is similar to [E0551](https://github.com/rust-lang/rust/blob/master/src/librustc_error_codes/error_codes/E0551.md) most of the content was copied from it. part of #61137.
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters