comparison libpam-sys/libpam-sys-impls/src/lib.rs @ 120:0f913ec120ac

Set rust-toolchain.toml; include span when parsing proc macro root.
author Paul Fisher <paul@pfish.zone>
date Mon, 30 Jun 2025 01:41:48 -0400
parents 39760dfc9b3b
children
comparison
equal deleted inserted replaced
119:476a22db8639 120:0f913ec120ac
6 use syn::Lit; 6 use syn::Lit;
7 7
8 // For documentation on this, see the `libpam-sys` crate. 8 // For documentation on this, see the `libpam-sys` crate.
9 #[proc_macro_attribute] 9 #[proc_macro_attribute]
10 pub fn cfg_pam_impl(attr: pm::TokenStream, item: pm::TokenStream) -> pm::TokenStream { 10 pub fn cfg_pam_impl(attr: pm::TokenStream, item: pm::TokenStream) -> pm::TokenStream {
11 Predicate::parse(attr.into(), None) 11 Predicate::parse(attr.into(), Some(Span::call_site()))
12 .map(|p| { 12 .map(|p| {
13 if p.matches(pam_impl_str()) { 13 if p.matches(pam_impl_str()) {
14 item 14 item
15 } else { 15 } else {
16 pm::TokenStream::new() 16 pm::TokenStream::new()