# Crate Features
| `dtor` | Enable support for the `#[dtor]` attribute. Deprecated: use the `dtor` crate directly instead. |
| `no_warn_on_missing_unsafe` | Do not warn when a ctor is missing the `unsafe` keyword. |
| `priority_enabled` | Enable support for the priority parameter. |
| `proc_macro` | Enable support for the proc-macro `#[ctor]` attribute. The declarative form (`ctor!(...)`) is always available. It is recommended that crates re-exporting the `ctor` macro disable this feature and only use the declarative form. |
| `std` | Enable support for the standard library. |
| `used_linker` | Applies `used(linker)` to all `ctor`-generated functions. Requires nightly and `feature(used_with_arg)`. |
# Macro Attributes
<table><tr><th>Attribute</th><th>Description</th></tr>
<tr><td><code>anonymous</code></td><td>
Do not give the constructor a name in the generated code (allows for
multiple constructors with the same name). Equivalent to wrapping the
constructor in an anonymous const (i.e.: `const _ = { ... };`).
</td></tr>
<tr><td><code>crate_path = $path : pat</code></td><td>
The path to the `ctor` crate containing the support macros. If you
re-export `ctor` items as part of your crate, you can use this to
redirect the macro’s output to the correct crate.
Using the declarative [`ctor!`][c] form is
preferred over this parameter.
[c]: crate::declarative::ctor!
</td></tr>
<tr><td><code>export_name_prefix = $export_name_prefix_str : literal</code></td><td>
Specify a custom export name prefix for the constructor function.
If specified, an export with the given prefix will be generated in the form:
`<prefix><priority>_<unique_id>`
</td></tr>
<tr><td><code>link_section = $section : literal</code></td><td>
Place the constructor function pointer in a custom link section. By
default, this uses the appropriate platform-specific link section.
</td></tr>
<tr><td><code>unsafe</code></td><td>
Marks a ctor as unsafe. Recommended.
</td></tr>
<tr><td><code>priority = $priority_value : tt</code></td><td>
The priority of the constructor. Higher-`N`-priority constructors are
run last. `N` must be between 0 and 999 for ordering guarantees (`N` >=
1000 ordering is platform-defined).
Ordering with respect to constructors without a priority is
platform-defined.
</td></tr>
<tr><td><code>used(linker)</code></td><td>
Mark generated functions for this `ctor` as `used(linker)`. Requires nightly and `feature(used_with_arg)`.
</td></tr>
</table>
# Defaults
## `export_name_prefix`
```rust
# #[cfg(false)] {
#[cfg(target_os = "aix")]
# const _: () = { let
export_name_prefix = "__sinit"
# ; };
// default
export_name_prefix = ()
# }
```
## `link_section`
```rust
# #[cfg(false)] {
#[cfg(target_vendor = "apple")]
# const _: () = { let
link_section = "__DATA,__mod_init_func,mod_init_funcs"
# ; };
#[cfg(any(target_os = "linux", target_os = "android", target_os = "freebsd",
target_os = "netbsd", target_os = "openbsd", target_os = "dragonfly",
target_os = "illumos", target_os = "haiku", target_os = "vxworks", target_os =
"nto", target_family = "wasm"))]
# const _: () = { let
link_section = ".init_array"
# ; };
#[cfg(target_os = "none")]
# const _: () = { let
link_section = ".init_array"
# ; };
#[cfg(target_arch = "xtensa")]
# const _: () = { let
link_section = ".ctors"
# ; };
#[cfg(all(target_vendor = "pc", any(target_env = "gnu", target_env = "msvc")))]
# const _: () = { let
link_section = ".CRT$XCU"
# ; };
#[cfg(all(target_vendor = "pc", not(any(target_env = "gnu", target_env = "msvc"))))]
# const _: () = { let
link_section = ".ctors"
# ; };
#[cfg(all(target_os = "aix"))]
# const _: () = { let
link_section = ()
# ; };
// default
link_section = (compile_error! ("Unsupported target for #[ctor]"))
# }
```