Add cast to type for constants to avoid mis-typing.
This commit is contained in:
committed by
J Henry Waugh
parent
848bdf3f01
commit
6dc5a81d53
@@ -140,12 +140,13 @@ impl Parse for Module {
|
||||
ref expr,
|
||||
ident,
|
||||
attrs,
|
||||
ty,
|
||||
..
|
||||
}) => {
|
||||
// #[cfg] attributes are not allowed on const declarations
|
||||
crate::attrs::deny_cfg_attr(&attrs)?;
|
||||
if let syn::Visibility::Public(_) = vis {
|
||||
consts.push((ident.to_string(), expr.as_ref().clone()));
|
||||
consts.push((ident.to_string(), ty.clone(), expr.as_ref().clone()));
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
Reference in New Issue
Block a user