+
+ impl alloc::fmt::Display for Features<$context> {
+ fn fmt(&self, fmt: &mut alloc::fmt::Formatter) -> Result<(), alloc::fmt::Error> {
+ $(
+ $(
+ fmt.write_fmt(format_args!("{}: {}, ", stringify!($required_feature),
+ if <$context as $required_feature>::requires_feature(&self.flags) { "required" }
+ else if <$context as $required_feature>::supports_feature(&self.flags) { "supported" }
+ else { "not supported" }))?;
+ )*
+ $(
+ fmt.write_fmt(format_args!("{}: {}, ", stringify!($optional_feature),
+ if <$context as $optional_feature>::requires_feature(&self.flags) { "required" }
+ else if <$context as $optional_feature>::supports_feature(&self.flags) { "supported" }
+ else { "not supported" }))?;
+ )*
+ )*
+ fmt.write_fmt(format_args!("unknown flags: {}",
+ if self.requires_unknown_bits() { "required" }
+ else if self.supports_unknown_bits() { "supported" } else { "none" }))
+ }
+ }