2015-11-25 00:00:26 +02:00
|
|
|
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
#![allow(non_snake_case)]
|
|
|
|
|
|
|
|
register_long_diagnostics! {
|
|
|
|
E0454: r##"
|
|
|
|
A link name was given with an empty name. Erroneous code example:
|
|
|
|
|
2016-08-19 16:44:29 +02:00
|
|
|
```compile_fail,E0454
|
2015-11-25 00:00:26 +02:00
|
|
|
#[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
|
|
|
|
```
|
|
|
|
|
|
|
|
The rust compiler cannot link to an external library if you don't give it its
|
|
|
|
name. Example:
|
|
|
|
|
2016-08-29 16:27:04 +02:00
|
|
|
```ignore
|
2015-11-25 00:00:26 +02:00
|
|
|
#[link(name = "some_lib")] extern {} // ok!
|
|
|
|
```
|
|
|
|
"##,
|
|
|
|
|
2016-05-04 00:40:53 -03:00
|
|
|
E0455: r##"
|
|
|
|
Linking with `kind=framework` is only supported when targeting OS X,
|
|
|
|
as frameworks are specific to that operating system.
|
|
|
|
|
|
|
|
Erroneous code example:
|
|
|
|
|
2016-09-08 16:08:47 +02:00
|
|
|
```ignore
|
|
|
|
#[link(name = "FooCoreServices", kind = "framework")] extern {}
|
2016-05-04 00:40:53 -03:00
|
|
|
// OS used to compile is Linux for example
|
|
|
|
```
|
|
|
|
|
|
|
|
To solve this error you can use conditional compilation:
|
|
|
|
|
|
|
|
```
|
|
|
|
#[cfg_attr(target="macos", link(name = "FooCoreServices", kind = "framework"))]
|
|
|
|
extern {}
|
|
|
|
```
|
|
|
|
|
|
|
|
See more: https://doc.rust-lang.org/book/conditional-compilation.html
|
|
|
|
"##,
|
|
|
|
|
2015-11-25 00:00:26 +02:00
|
|
|
E0458: r##"
|
|
|
|
An unknown "kind" was specified for a link attribute. Erroneous code example:
|
|
|
|
|
2016-08-19 16:44:29 +02:00
|
|
|
```compile_fail,E0458
|
2015-11-25 00:00:26 +02:00
|
|
|
#[link(kind = "wonderful_unicorn")] extern {}
|
|
|
|
// error: unknown kind: `wonderful_unicorn`
|
|
|
|
```
|
|
|
|
|
|
|
|
Please specify a valid "kind" value, from one of the following:
|
2016-11-25 22:58:30 +03:00
|
|
|
|
2016-12-22 17:35:53 +05:30
|
|
|
* static
|
|
|
|
* dylib
|
|
|
|
* framework
|
2016-11-26 21:19:30 +03:00
|
|
|
|
2015-11-25 00:00:26 +02:00
|
|
|
"##,
|
|
|
|
|
|
|
|
E0459: r##"
|
|
|
|
A link was used without a name parameter. Erroneous code example:
|
|
|
|
|
2016-08-19 16:44:29 +02:00
|
|
|
```compile_fail,E0459
|
2015-11-25 00:00:26 +02:00
|
|
|
#[link(kind = "dylib")] extern {}
|
|
|
|
// error: #[link(...)] specified without `name = "foo"`
|
|
|
|
```
|
|
|
|
|
|
|
|
Please add the name parameter to allow the rust compiler to find the library
|
|
|
|
you want. Example:
|
|
|
|
|
2016-08-29 16:27:04 +02:00
|
|
|
```ignore
|
2015-11-25 00:00:26 +02:00
|
|
|
#[link(kind = "dylib", name = "some_lib")] extern {} // ok!
|
|
|
|
```
|
|
|
|
"##,
|
|
|
|
|
2015-12-08 15:30:35 +01:00
|
|
|
E0463: r##"
|
|
|
|
A plugin/crate was declared but cannot be found. Erroneous code example:
|
|
|
|
|
2016-08-19 16:44:29 +02:00
|
|
|
```compile_fail,E0463
|
2015-12-08 15:30:35 +01:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
|
|
|
|
extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
|
|
|
|
```
|
|
|
|
|
|
|
|
You need to link your code to the relevant crate in order to be able to use it
|
|
|
|
(through Cargo or the `-L` option of rustc example). Plugins are crates as
|
|
|
|
well, and you link to them the same way.
|
|
|
|
"##,
|
|
|
|
|
2015-11-25 00:00:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
register_diagnostics! {
|
|
|
|
E0456, // plugin `..` is not available for triple `..`
|
|
|
|
E0457, // plugin `..` only found in rlib format, but must be available...
|
|
|
|
E0514, // metadata version mismatch
|
|
|
|
E0460, // found possibly newer version of crate `..`
|
|
|
|
E0461, // couldn't find crate `..` with expected target triple ..
|
|
|
|
E0462, // found staticlib `..` instead of rlib or dylib
|
|
|
|
E0464, // multiple matching crates for `..`
|
|
|
|
E0465, // multiple .. candidates for `..` found
|
2016-02-26 16:25:25 -05:00
|
|
|
E0519, // local crate and dependency have same (crate-name, disambiguator)
|
2016-03-22 12:18:30 -04:00
|
|
|
E0523, // two dependencies have same (crate-name, disambiguator) but different SVH
|
2015-11-25 00:00:26 +02:00
|
|
|
}
|