1 use syntax::{register_diagnostics, register_long_diagnostics};
3 register_long_diagnostics! {
5 A link name was given with an empty name. Erroneous code example:
7 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
8 #[link(name = "")] extern {}
9 // error: `#[link(name = "")]` given with empty name
12 The rust compiler cannot link to an external library if you don't give it its
16 #[link(name = "some_lib")] extern {} // ok!
21 Linking with `kind=framework` is only supported when targeting macOS,
22 as frameworks are specific to that operating system.
24 Erroneous code example:
26 ```ignore (should-compile_fail-but-cannot-doctest-conditionally-without-macos)
27 #[link(name = "FooCoreServices", kind = "framework")] extern {}
28 // OS used to compile is Linux for example
31 To solve this error you can use conditional compilation:
34 #[cfg_attr(target="macos", link(name = "FooCoreServices", kind = "framework"))]
39 https://doc.rust-lang.org/reference/attributes.html#conditional-compilation
43 An unknown "kind" was specified for a link attribute. Erroneous code example:
45 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
46 #[link(kind = "wonderful_unicorn")] extern {}
47 // error: unknown kind: `wonderful_unicorn`
50 Please specify a valid "kind" value, from one of the following:
59 A link was used without a name parameter. Erroneous code example:
61 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
62 #[link(kind = "dylib")] extern {}
63 // error: `#[link(...)]` specified without `name = "foo"`
66 Please add the name parameter to allow the rust compiler to find the library
70 #[link(kind = "dylib", name = "some_lib")] extern {} // ok!
75 A plugin/crate was declared but cannot be found. Erroneous code example:
79 #![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
80 extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
83 You need to link your code to the relevant crate in order to be able to use it
84 (through Cargo or the `-L` option of rustc example). Plugins are crates as
85 well, and you link to them the same way.
90 register_diagnostics! {
91 E0456, // plugin `..` is not available for triple `..`
92 E0457, // plugin `..` only found in rlib format, but must be available...
93 E0514, // metadata version mismatch
94 E0460, // found possibly newer version of crate `..`
95 E0461, // couldn't find crate `..` with expected target triple ..
96 E0462, // found staticlib `..` instead of rlib or dylib
97 E0464, // multiple matching crates for `..`
98 E0465, // multiple .. candidates for `..` found
99 E0519, // local crate and dependency have same (crate-name, disambiguator)
100 E0523, // two dependencies have same (crate-name, disambiguator) but different SVH