added future extensibility for extensions

This commit is contained in:
Georg Echterling 2016-11-10 21:26:23 +01:00
parent 667dd6d0df
commit c2a8492313

View File

@ -28,6 +28,9 @@ macro_rules! extensions {
$(
pub $ext: bool,
)*
/// Helper for future extensibility.
pub _hidden: Hidden,
}
impl $sname {
@ -36,6 +39,7 @@ macro_rules! extensions {
pub fn none() -> $sname {
$sname {
$($ext: false,)*
_hidden: Hidden(())
}
}
@ -53,6 +57,7 @@ macro_rules! extensions {
$(
$ext: self.$ext && other.$ext,
)*
_hidden: Hidden(())
}
}
}
@ -197,6 +202,10 @@ impl From<Error> for SupportedExtensionsError {
}
}
/// Non-constructible helper for future extensibility of extension structs.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct Hidden(());
#[cfg(test)]
mod tests {
use instance::InstanceExtensions;