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`.