Add lots of rustdocs and clean up one line of code

This commit is contained in:
Mark McCaskey
2019-09-26 17:15:43 -07:00
parent 287b42579c
commit dc1744560c
10 changed files with 53 additions and 7 deletions

View File

@ -22,6 +22,7 @@ pub mod sys {
}
pub use crate::sig_registry::SigRegistry;
/// Enum used to select which compiler should be used to generate code
#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialEq, Eq)]
pub enum Backend {
Cranelift,
@ -30,6 +31,7 @@ pub enum Backend {
}
impl Backend {
/// Get a list of the currently enabled (via feature flag) backends
pub fn variants() -> &'static [&'static str] {
&[
#[cfg(feature = "backend-cranelift")]
@ -41,7 +43,7 @@ impl Backend {
]
}
/// stable string representation of the backend
/// Stable string representation of the backend
/// can be used as part of a cache key, for example
pub fn to_string(&self) -> &'static str {
match self {
@ -111,6 +113,7 @@ impl Default for MemoryBoundCheckMode {
}
}
/// Controls which experimental features will be enabled
#[derive(Debug, Default)]
pub struct Features {
pub simd: bool,