diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-07-29 06:11:47 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-29 06:11:47 +0900 |
| commit | 1d5f15f9fb4b7bba8b93014e0e49e52e5c5232c0 (patch) | |
| tree | 130c387ba30818eb3867bead9da8729228ac53d9 | |
| parent | aa301a06604a0cd541f65deeadc16f9befb24249 (diff) | |
| parent | bc70252f5039281388028faf2adec9c6f58aeab3 (diff) | |
| download | rust-1d5f15f9fb4b7bba8b93014e0e49e52e5c5232c0.tar.gz rust-1d5f15f9fb4b7bba8b93014e0e49e52e5c5232c0.zip | |
Rollup merge of #87521 - midgleyc:long-E0498, r=GuillaumeGomez
Add long explanation for E0498 Helps with #61137
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0498.md | 22 | ||||
| -rw-r--r-- | src/test/ui-fulldeps/plugin-args.stderr | 1 | ||||
| -rw-r--r-- | src/test/ui/malformed/malformed-plugin-3.stderr | 1 |
4 files changed, 25 insertions, 1 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index 6f65d386f0d..65999ba707c 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -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"), @@ -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 diff --git a/compiler/rustc_error_codes/src/error_codes/E0498.md b/compiler/rustc_error_codes/src/error_codes/E0498.md new file mode 100644 index 00000000000..c9ea4a7947f --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0498.md @@ -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 diff --git a/src/test/ui-fulldeps/plugin-args.stderr b/src/test/ui-fulldeps/plugin-args.stderr index 2e255f185e2..177f33005c8 100644 --- a/src/test/ui-fulldeps/plugin-args.stderr +++ b/src/test/ui-fulldeps/plugin-args.stderr @@ -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`. diff --git a/src/test/ui/malformed/malformed-plugin-3.stderr b/src/test/ui/malformed/malformed-plugin-3.stderr index 11abdb16e0b..64cb429ea74 100644 --- a/src/test/ui/malformed/malformed-plugin-3.stderr +++ b/src/test/ui/malformed/malformed-plugin-3.stderr @@ -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`. |
