Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add long explanation for E0498 #87521

Merged
merged 2 commits into from
Jul 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_error_codes/src/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ E0493: include_str!("./error_codes/E0493.md"),
E0495: include_str!("./error_codes/E0495.md"),
E0496: include_str!("./error_codes/E0496.md"),
E0497: include_str!("./error_codes/E0497.md"),
E0498: include_str!("./error_codes/E0498.md"),
E0499: include_str!("./error_codes/E0499.md"),
E0500: include_str!("./error_codes/E0500.md"),
E0501: include_str!("./error_codes/E0501.md"),
Expand Down Expand Up @@ -604,7 +605,6 @@ E0783: include_str!("./error_codes/E0783.md"),
// E0488, // lifetime of variable does not enclose its declaration
// E0489, // type/lifetime parameter not in scope here
E0490, // a value of type `..` is borrowed for too long
E0498, // malformed plugin attribute
E0514, // metadata version mismatch
E0519, // local crate and dependency have same (crate-name, disambiguator)
// two dependencies have same (crate-name, disambiguator) but different SVH
Expand Down
22 changes: 22 additions & 0 deletions compiler/rustc_error_codes/src/error_codes/E0498.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The `plugin` attribute was malformed.

Erroneous code example:

```compile_fail,E0498
#![feature(plugin)]
#![plugin(foo(args))] // error: invalid argument
#![plugin(bar="test")] // error: invalid argument
```

The `#[plugin]` attribute should take a single argument: the name of the plugin.

For example, for the plugin `foo`:

```ignore (requires external plugin crate)
#![feature(plugin)]
#![plugin(foo)] // ok!
```

See the [`plugin` feature] section of the Unstable book for more details.

[`plugin` feature]: https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html
1 change: 1 addition & 0 deletions src/test/ui-fulldeps/plugin-args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ LL | #![plugin(empty_plugin(args))]

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0498`.
1 change: 1 addition & 0 deletions src/test/ui/malformed/malformed-plugin-3.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ LL | #![plugin(foo="bleh")]

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0498`.