@@ -15,13 +15,13 @@ through the usage of either command line flags or the `crate_type` attribute.
15
15
If one or more command line flags are specified, all ` crate_type ` attributes will
16
16
be ignored in favor of only building the artifacts specified by command line.
17
17
18
- * ` --crate-type=bin ` , ` #[crate_type = "bin"] ` - A runnable executable will be
18
+ * ` --crate-type=bin ` , ` #! [crate_type = "bin"] ` - A runnable executable will be
19
19
produced. This requires that there is a ` main ` function in the crate which
20
20
will be run when the program begins executing. This will link in all Rust and
21
21
native dependencies, producing a single distributable binary.
22
22
This is the default crate type.
23
23
24
- * ` --crate-type=lib ` , ` #[crate_type = "lib"] ` - A Rust library will be produced.
24
+ * ` --crate-type=lib ` , ` #! [crate_type = "lib"] ` - A Rust library will be produced.
25
25
This is an ambiguous concept as to what exactly is produced because a library
26
26
can manifest itself in several forms. The purpose of this generic ` lib ` option
27
27
is to generate the "compiler recommended" style of library. The output library
@@ -30,14 +30,14 @@ be ignored in favor of only building the artifacts specified by command line.
30
30
libraries, and the ` lib ` type can be seen as an alias for one of them (but the
31
31
actual one is compiler-defined).
32
32
33
- * ` --crate-type=dylib ` , ` #[crate_type = "dylib"] ` - A dynamic Rust library will
33
+ * ` --crate-type=dylib ` , ` #! [crate_type = "dylib"] ` - A dynamic Rust library will
34
34
be produced. This is different from the ` lib ` output type in that this forces
35
35
dynamic library generation. The resulting dynamic library can be used as a
36
36
dependency for other libraries and/or executables. This output type will
37
37
create ` *.so ` files on Linux, ` *.dylib ` files on macOS, and ` *.dll ` files on
38
38
Windows.
39
39
40
- * ` --crate-type=staticlib ` , ` #[crate_type = "staticlib"] ` - A static system
40
+ * ` --crate-type=staticlib ` , ` #! [crate_type = "staticlib"] ` - A static system
41
41
library will be produced. This is different from other library outputs in that
42
42
the compiler will never attempt to link to ` staticlib ` outputs. The
43
43
purpose of this output type is to create a static library containing all of
@@ -47,21 +47,21 @@ be ignored in favor of only building the artifacts specified by command line.
47
47
linking Rust code into an existing non-Rust application
48
48
because it will not have dynamic dependencies on other Rust code.
49
49
50
- * ` --crate-type=cdylib ` , ` #[crate_type = "cdylib"] ` - A dynamic system
50
+ * ` --crate-type=cdylib ` , ` #! [crate_type = "cdylib"] ` - A dynamic system
51
51
library will be produced. This is used when compiling
52
52
a dynamic library to be loaded from another language. This output type will
53
53
create ` *.so ` files on Linux, ` *.dylib ` files on macOS, and ` *.dll ` files on
54
54
Windows.
55
55
56
- * ` --crate-type=rlib ` , ` #[crate_type = "rlib"] ` - A "Rust library" file will be
56
+ * ` --crate-type=rlib ` , ` #! [crate_type = "rlib"] ` - A "Rust library" file will be
57
57
produced. This is used as an intermediate artifact and can be thought of as a
58
58
"static Rust library". These ` rlib ` files, unlike ` staticlib ` files, are
59
59
interpreted by the compiler in future linkage. This essentially means
60
60
that ` rustc ` will look for metadata in ` rlib ` files like it looks for metadata
61
61
in dynamic libraries. This form of output is used to produce statically linked
62
62
executables as well as ` staticlib ` outputs.
63
63
64
- * ` --crate-type=proc-macro ` , ` #[crate_type = "proc-macro"] ` - The output
64
+ * ` --crate-type=proc-macro ` , ` #! [crate_type = "proc-macro"] ` - The output
65
65
produced is not specified, but if a ` -L ` path is provided to it then the
66
66
compiler will recognize the output artifacts as a macro and it can be loaded
67
67
for a program. Crates compiled with this crate type must only export
0 commit comments