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