File tree 3 files changed +38
-1
lines changed
compiler/rustc_error_codes/src
3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ E0452: include_str!("./error_codes/E0452.md"),
239
239
E0453 : include_str!( "./error_codes/E0453.md" ) ,
240
240
E0454 : include_str!( "./error_codes/E0454.md" ) ,
241
241
E0455 : include_str!( "./error_codes/E0455.md" ) ,
242
+ E0457 : include_str!( "./error_codes/E0457.md" ) ,
242
243
E0458 : include_str!( "./error_codes/E0458.md" ) ,
243
244
E0459 : include_str!( "./error_codes/E0459.md" ) ,
244
245
E0460 : include_str!( "./error_codes/E0460.md" ) ,
@@ -593,7 +594,6 @@ E0791: include_str!("./error_codes/E0791.md"),
593
594
// E0421, // merged into 531
594
595
// E0427, // merged into 530
595
596
// E0456, // plugin `..` is not available for triple `..`
596
- E0457 , // plugin `..` only found in rlib format, but must be available...
597
597
E0461 , // couldn't find crate `..` with expected target triple ..
598
598
E0462 , // found staticlib `..` instead of rlib or dylib
599
599
E0465 , // multiple .. candidates for `..` found
Original file line number Diff line number Diff line change
1
+ Plugin ` .. ` only found in rlib format, but must be available in dylib format.
2
+
3
+ Erroronous code example:
4
+
5
+ ` rlib-plugin.rs `
6
+ ``` ignore (needs-linkage-with-other-tests)
7
+ #![crate_type = "rlib"]
8
+ #![feature(rustc_private)]
9
+
10
+ extern crate rustc_middle;
11
+ extern crate rustc_driver;
12
+
13
+ use rustc_driver::plugin::Registry;
14
+
15
+ #[no_mangle]
16
+ fn __rustc_plugin_registrar(_: &mut Registry) {}
17
+ ```
18
+
19
+ ` main.rs `
20
+ ``` ignore (needs-linkage-with-other-tests)
21
+ #![feature(plugin)]
22
+ #![plugin(rlib_plugin)] // error: plugin `rlib_plugin` only found in rlib
23
+ // format, but must be available in dylib
24
+
25
+ fn main() {}
26
+ ```
27
+
28
+ The compiler exposes a plugin interface to allow altering the compile process
29
+ (adding lints, etc). Plugins must be defined in their own crates (similar to
30
+ [ proc-macro] ( ../reference/procedural-macros.html ) isolation) and then compiled
31
+ and linked to another crate. Plugin crates * must* be compiled to the
32
+ dynamically-linked dylib format, and not the statically-linked rlib format.
33
+ Learn more about different output types in
34
+ [ this section] ( ../reference/linkage.html ) of the Rust reference.
35
+
36
+ This error is easily fixed by recompiling the plugin crate in the dylib format.
Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ LL | #![plugin(rlib_crate_test)]
6
6
7
7
error: aborting due to previous error
8
8
9
+ For more information about this error, try `rustc --explain E0457`.
You can’t perform that action at this time.
0 commit comments