]> git.lizzy.rs Git - rust.git/blob - src/librustc_metadata/error_codes.rs
Rollup merge of #65592 - RalfJung:const-prop-comment, r=wesleywiser
[rust.git] / src / librustc_metadata / error_codes.rs
1 syntax::register_diagnostics! {
2 E0454: r##"
3 A link name was given with an empty name. Erroneous code example:
4
5 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
6 #[link(name = "")] extern {}
7 // error: `#[link(name = "")]` given with empty name
8 ```
9
10 The rust compiler cannot link to an external library if you don't give it its
11 name. Example:
12
13 ```no_run
14 #[link(name = "some_lib")] extern {} // ok!
15 ```
16 "##,
17
18 E0455: r##"
19 Linking with `kind=framework` is only supported when targeting macOS,
20 as frameworks are specific to that operating system.
21
22 Erroneous code example:
23
24 ```ignore (should-compile_fail-but-cannot-doctest-conditionally-without-macos)
25 #[link(name = "FooCoreServices", kind = "framework")] extern {}
26 // OS used to compile is Linux for example
27 ```
28
29 To solve this error you can use conditional compilation:
30
31 ```
32 #[cfg_attr(target="macos", link(name = "FooCoreServices", kind = "framework"))]
33 extern {}
34 ```
35
36 See more:
37 https://doc.rust-lang.org/reference/attributes.html#conditional-compilation
38 "##,
39
40 E0458: r##"
41 An unknown "kind" was specified for a link attribute. Erroneous code example:
42
43 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
44 #[link(kind = "wonderful_unicorn")] extern {}
45 // error: unknown kind: `wonderful_unicorn`
46 ```
47
48 Please specify a valid "kind" value, from one of the following:
49
50 * static
51 * dylib
52 * framework
53
54 "##,
55
56 E0459: r##"
57 A link was used without a name parameter. Erroneous code example:
58
59 ```ignore (cannot-test-this-because-rustdoc-stops-compile-fail-before-codegen)
60 #[link(kind = "dylib")] extern {}
61 // error: `#[link(...)]` specified without `name = "foo"`
62 ```
63
64 Please add the name parameter to allow the rust compiler to find the library
65 you want. Example:
66
67 ```no_run
68 #[link(kind = "dylib", name = "some_lib")] extern {} // ok!
69 ```
70 "##,
71
72 E0463: r##"
73 A plugin/crate was declared but cannot be found. Erroneous code example:
74
75 ```compile_fail,E0463
76 #![feature(plugin)]
77 #![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
78 extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
79 ```
80
81 You need to link your code to the relevant crate in order to be able to use it
82 (through Cargo or the `-L` option of rustc example). Plugins are crates as
83 well, and you link to them the same way.
84 "##,
85 ;
86     E0456, // plugin `..` is not available for triple `..`
87     E0457, // plugin `..` only found in rlib format, but must be available...
88     E0514, // metadata version mismatch
89     E0460, // found possibly newer version of crate `..`
90     E0461, // couldn't find crate `..` with expected target triple ..
91     E0462, // found staticlib `..` instead of rlib or dylib
92     E0464, // multiple matching crates for `..`
93     E0465, // multiple .. candidates for `..` found
94     E0519, // local crate and dependency have same (crate-name, disambiguator)
95     // two dependencies have same (crate-name, disambiguator) but different SVH
96     E0523,
97 }