Skip to content

Commit 85e0242

Browse files
Add error description for E0455
- Adding name attribute to the sample code - Fix description sentences
1 parent 3157691 commit 85e0242

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/librustc_metadata/diagnostics.rs

+21-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ name. Example:
2626
```
2727
"##,
2828

29+
E0455: r##"
30+
Linking with `kind=framework` is only supported when targeting OS X,
31+
as frameworks are specific to that operating system.
32+
33+
Erroneous code example:
34+
35+
```compile_fail"
36+
#[link(name = "FooCoreServices", kind = "framework")] extern {}
37+
// OS used to compile is Linux for example
38+
```
39+
40+
To solve this error you can use conditional compilation:
41+
42+
```
43+
#[cfg_attr(target="macos", link(name = "FooCoreServices", kind = "framework"))]
44+
extern {}
45+
```
46+
47+
See more: https://doc.rust-lang.org/book/conditional-compilation.html
48+
"##,
49+
2950
E0458: r##"
3051
An unknown "kind" was specified for a link attribute. Erroneous code example:
3152
@@ -73,7 +94,6 @@ well, and you link to them the same way.
7394
}
7495

7596
register_diagnostics! {
76-
E0455, // native frameworks are only available on OSX targets
7797
E0456, // plugin `..` is not available for triple `..`
7898
E0457, // plugin `..` only found in rlib format, but must be available...
7999
E0514, // metadata version mismatch

0 commit comments

Comments
 (0)