]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0457.md
New upstream version 1.75.0+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0457.md
CommitLineData
ed00b5ec
FG
1#### Note: this error code is no longer emitted by the compiler`
2
9c376795
FG
3Plugin `..` only found in rlib format, but must be available in dylib format.
4
49aad941 5Erroneous code example:
9c376795
FG
6
7`rlib-plugin.rs`
8```ignore (needs-linkage-with-other-tests)
9#![crate_type = "rlib"]
10#![feature(rustc_private)]
11
12extern crate rustc_middle;
13extern crate rustc_driver;
14
15use rustc_driver::plugin::Registry;
16
17#[no_mangle]
18fn __rustc_plugin_registrar(_: &mut Registry) {}
19```
20
21`main.rs`
22```ignore (needs-linkage-with-other-tests)
23#![feature(plugin)]
24#![plugin(rlib_plugin)] // error: plugin `rlib_plugin` only found in rlib
25 // format, but must be available in dylib
26
27fn main() {}
28```
29
30The compiler exposes a plugin interface to allow altering the compile process
31(adding lints, etc). Plugins must be defined in their own crates (similar to
32[proc-macro](../reference/procedural-macros.html) isolation) and then compiled
33and linked to another crate. Plugin crates *must* be compiled to the
34dynamically-linked dylib format, and not the statically-linked rlib format.
35Learn more about different output types in
36[this section](../reference/linkage.html) of the Rust reference.
37
38This error is easily fixed by recompiling the plugin crate in the dylib format.