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