diff options
| author | Havvy <ryan.havvy@gmail.com> | 2018-06-11 01:52:12 -0700 |
|---|---|---|
| committer | Havvy <ryan.havvy@gmail.com> | 2018-06-11 01:52:12 -0700 |
| commit | f7df1f38dd2a52709cd83aeb6d6714215fe046bc (patch) | |
| tree | 505a1af9cc204970874f913b8d08c93e34a8b450 /src/libsyntax/diagnostic_list.rs | |
| parent | a32e979ba53af4d4654bfad7babdb9f8c197c3a2 (diff) | |
| download | rust-f7df1f38dd2a52709cd83aeb6d6714215fe046bc.tar.gz rust-f7df1f38dd2a52709cd83aeb6d6714215fe046bc.zip | |
Long diagnostic for E0541
Diffstat (limited to 'src/libsyntax/diagnostic_list.rs')
| -rw-r--r-- | src/libsyntax/diagnostic_list.rs | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index 5f940437ab3..35e2b701791 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -93,6 +93,35 @@ For more information about the cfg attribute, read: https://doc.rust-lang.org/reference.html#conditional-compilation "##, +E0541: r##" +An unknown meta item was used. + +Erroneous code example: + +```compile_fail,E0541 +#[deprecated( + since="1.0.0", + reason="Example invalid meta item. Should be 'note'") // error: unknown meta item +] +fn deprecated_function() {} + +Meta items are the key/value pairs inside of an attribute. The keys provided must be one of the +valid keys for the specified attribute. + +To fix the problem, either remove the unknown meta item, or rename it it you provided the wrong +name. + +In the erroneous code example above, the wrong name was provided, so changing it to the right name +fixes the error. + +``` +#[deprecated( + since="1.0.0", + note="This is a valid meta item for the deprecated attribute." +)] +fn deprecated_function() {} +"##, + E0552: r##" A unrecognized representation attribute was used. @@ -318,7 +347,6 @@ register_diagnostics! { E0538, // multiple [same] items E0539, // incorrect meta item E0540, // multiple rustc_deprecated attributes - E0541, // unknown meta item E0542, // missing 'since' E0543, // missing 'reason' E0544, // multiple stability levels |
