#![recursion_limit = "256"]
#![no_std]
#![doc = include_str!("../docs/BUILD.md")]
#![doc = include_str!("../docs/PREAMBLE.md")]
#![doc = include_str!("../docs/GENERATED.md")]
#![cfg_attr(linktime_used_linker, doc(test(attr(feature(used_with_arg)))))]
#[cfg(feature = "std")]
extern crate std;
mod macros;
mod native;
mod parse;
#[doc = include_str!("../docs/LIFE_BEFORE_MAIN.md")]
pub mod life_before_main {}
pub use native::*;
#[doc(inline)]
#[cfg(feature = "proc_macro")]
pub use linktime_proc_macro::dtor;
pub mod declarative {
#[doc(inline)]
pub use crate::__dtor_parse as dtor;
}
#[doc(hidden)]
#[allow(unused)]
pub mod __support {
use crate::macros::*;
pub use crate::__dtor_parse as dtor_parse;
pub use crate::native::*;
}
__declare_features!(
dtor: __dtor_features;
anonymous {
attr: [(anonymous) => (anonymous)];
};
crate_path {
attr: [(crate_path = $path:pat) => (($path))];
example: "crate_path = ::path::to::dtor::crate";
};
ctor_export_name_prefix {
attr: [(ctor(export_name_prefix = $ctor_export_name_prefix_str:literal)) => ($ctor_export_name_prefix_str)];
example: "ctor(export_name_prefix = \"ctor_\")";
default {
(target_os = "aix") => "__sinit80000000",
_ => (),
}
};
ctor_link_section {
attr: [(ctor(link_section = $ctor_link_section_name:literal)) => ($ctor_link_section_name)];
example: "ctor(link_section = \".ctors\")";
default {
(target_vendor = "apple") => "__DATA,__mod_init_func,mod_init_funcs",
(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"
)) => ".init_array",
(target_os = "none") => ".init_array",
(target_arch = "xtensa") => ".ctors",
(all(target_vendor = "pc", any(target_env = "gnu", target_env = "msvc"))) => ".CRT$XCU",
(all(target_vendor = "pc", not(any(target_env = "gnu", target_env = "msvc")))) => ".ctors",
(all(target_os = "aix")) => (), _ => (compile_error!("Unsupported target for #[ctor]"))
}
};
default_term_method {
default {
(target_vendor = "pc") => at_module_exit,
_ => at_binary_exit,
}
};
default_unload_method {
default {
_ => at_module_exit,
}
};
export_name_prefix {
attr: [(export_name_prefix = $export_name_prefix_str:literal) => ($export_name_prefix_str)];
example: "export_name_prefix = \"ctor_\"";
default {
(target_os = "aix") => "__sterm80000000",
_ => (),
}
};
link_section {
attr: [(link_section = $section:literal) => ($section)];
example: "link_section = \".dtors\"";
default {
(target_vendor = "apple") => "__DATA,__mod_term_func,mod_term_funcs",
(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"
)) => ".fini_array",
(target_os = "none") => ".fini_array",
(target_arch = "xtensa") => ".dtors",
(all(target_vendor = "pc", any(target_env = "gnu", target_env = "msvc"))) => ".CRT$XPU",
(all(target_vendor = "pc", not(any(target_env = "gnu", target_env = "msvc")))) => ".dtors",
(all(target_os = "aix")) => (), _ => (compile_error!("Unsupported target for #[dtor]"))
}
};
method {
attr: [(method = $method_id:ident) => ($method_id)];
example: "method = term|unload|at_module_exit|at_binary_exit|linker";
validate: [(term), (unload), (at_module_exit), (at_binary_exit), (linker)];
default {
(target_vendor = "apple") => at_module_exit,
(target_vendor = "pc") => at_module_exit,
(target_family = "wasm") => at_binary_exit,
_ => linker,
}
};
proc_macro {
feature: "proc_macro";
};
std {
feature: "std";
};
r#unsafe {
attr: [(unsafe) => (no_fail_on_missing_unsafe)];
default {
(linktime_no_fail_on_missing_unsafe) => (no_fail_on_missing_unsafe),
_ => (),
}
};
used_linker {
attr: [(used(linker)) => (used_linker)];
default {
(linktime_used_linker) => used_linker,
_ => (),
}
};
);
#[cfg(doc)]
__generate_docs!(__dtor_features);