(arg: &NestedMetaItem)
| 537 | } |
| 538 | |
| 539 | fn parse_attr_int_value(arg: &NestedMetaItem) -> Result<u32, ParseAttrError> { |
| 540 | let arg = match arg.meta_item() { |
| 541 | Some(arg) => arg, |
| 542 | None => return Err((arg.span(), "attribute must have value".to_string())), |
| 543 | }; |
| 544 | match arg.name_value_literal() { |
| 545 | Some(&MetaItemLit { |
| 546 | kind: LitKind::Int(x, LitIntType::Unsuffixed), |
| 547 | .. |
| 548 | }) if x <= u32::MAX as u128 => Ok(x as u32), |
| 549 | _ => Err((arg.span, "attribute value must be integer".to_string())), |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | fn parse_local_size_attr(arg: &NestedMetaItem) -> Result<[u32; 3], ParseAttrError> { |
| 554 | let arg = match arg.meta_item() { |
no test coverage detected