]> git.proxmox.com Git - rustc.git/blob - src/librustc_metadata/diagnostics.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / librustc_metadata / diagnostics.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![allow(non_snake_case)]
12
13 register_long_diagnostics! {
14 E0454: r##"
15 A link name was given with an empty name. Erroneous code example:
16
17 ```
18 #[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
19 ```
20
21 The rust compiler cannot link to an external library if you don't give it its
22 name. Example:
23
24 ```
25 #[link(name = "some_lib")] extern {} // ok!
26 ```
27 "##,
28
29 E0458: r##"
30 An unknown "kind" was specified for a link attribute. Erroneous code example:
31
32 ```
33 #[link(kind = "wonderful_unicorn")] extern {}
34 // error: unknown kind: `wonderful_unicorn`
35 ```
36
37 Please specify a valid "kind" value, from one of the following:
38 * static
39 * dylib
40 * framework
41 "##,
42
43 E0459: r##"
44 A link was used without a name parameter. Erroneous code example:
45
46 ```
47 #[link(kind = "dylib")] extern {}
48 // error: #[link(...)] specified without `name = "foo"`
49 ```
50
51 Please add the name parameter to allow the rust compiler to find the library
52 you want. Example:
53
54 ```
55 #[link(kind = "dylib", name = "some_lib")] extern {} // ok!
56 ```
57 "##,
58
59 E0463: r##"
60 A plugin/crate was declared but cannot be found. Erroneous code example:
61
62 ```
63 #![feature(plugin)]
64 #![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
65 extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
66 ```
67
68 You need to link your code to the relevant crate in order to be able to use it
69 (through Cargo or the `-L` option of rustc example). Plugins are crates as
70 well, and you link to them the same way.
71 "##,
72
73 }
74
75 register_diagnostics! {
76 E0455, // native frameworks are only available on OSX targets
77 E0456, // plugin `..` is not available for triple `..`
78 E0457, // plugin `..` only found in rlib format, but must be available...
79 E0514, // metadata version mismatch
80 E0460, // found possibly newer version of crate `..`
81 E0461, // couldn't find crate `..` with expected target triple ..
82 E0462, // found staticlib `..` instead of rlib or dylib
83 E0464, // multiple matching crates for `..`
84 E0465, // multiple .. candidates for `..` found
85 E0466, // bad macro import
86 E0467, // bad macro reexport
87 E0468, // an `extern crate` loading macros must be at the crate root
88 E0469, // imported macro not found
89 E0470, // reexported macro not found
90 E0519, // local crate and dependency have same (crate-name, disambiguator)
91 E0523, // two dependencies have same (crate-name, disambiguator) but different SVH
92 }