This isn't complete yet, because we need to use this in more places
and also arrange not to treat these as "allowed but in the wrong
section" but "not a known config key".
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
method = attr.path.to_token_stream();
if &attr.path == &parse_quote!{ limited } {
skl = quote_spanned!{atspan=> SectionKindList::Limited };
+ } else if &attr.path == &parse_quote!{ computed } {
+ skl = quote_spanned!{atspan=> SectionKindList::None };
}
} else if &attr.path == &parse_quote!{ special } {
let meta = match attr.parse_meta().unwrap() {
Limits,
Global,
ServerName,
+ None,
}
use SectionKindList as SKL;
SKL::ServerName => matches!(s, SN::Common)
| matches!(s, SN::Server(ServerName(name))
if name == SPECIAL_SERVER_SECTION),
+ SKL::None => false,
}
}
}
}
#[throws(AE)]
- pub fn computed<T>(&self, _key: &'static str, _skl: SKL) -> T
+ pub fn computed<T>(&self, _key: &'static str, skl: SKL) -> T
where T: Default
{
+ assert_eq!(skl, SKL::None);
default()
}