diff options
| author | bors <bors@rust-lang.org> | 2018-06-11 15:28:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-11 15:28:44 +0000 |
| commit | 0b7c9e756e8bee2efd4f6929c79f9e3ed9115689 (patch) | |
| tree | 0870129db596291c2fa79cbf3387efba4dc37eb5 /src/libsyntax | |
| parent | 0d763178e5375cdba1eb1feecab14dc293cbbf1c (diff) | |
| parent | cf3fcab9732f080222b21bce8399c97e97f2e3e9 (diff) | |
| download | rust-0b7c9e756e8bee2efd4f6929c79f9e3ed9115689.tar.gz rust-0b7c9e756e8bee2efd4f6929c79f9e3ed9115689.zip | |
Auto merge of #51490 - Havvy:diagnostic-list, r=GuillaumeGomez
Long diagnostic for E0541 r? @GuillaumeGomez
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/diagnostic_list.rs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/libsyntax/diagnostic_list.rs b/src/libsyntax/diagnostic_list.rs index 5f940437ab3..9775a6475cc 100644 --- a/src/libsyntax/diagnostic_list.rs +++ b/src/libsyntax/diagnostic_list.rs @@ -93,6 +93,38 @@ 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", + // error: unknown meta item + reason="Example invalid meta item. Should be 'note'") +] +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 if you +provided the wrong name. + +In the erroneous code example above, the wrong name was provided, so changing +to a correct one it will fix the error. Example: + +``` +#[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 +350,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 |
