mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-24 07:40:19 +00:00
Simplify discriminant overflow check
This commit is contained in:
parent
a3f6407efa
commit
4301f3ca51
@ -111,7 +111,7 @@ fn parse_enum(item: ItemEnum) -> Result<Api> {
|
||||
));
|
||||
}
|
||||
}
|
||||
if variant.discriminant.is_none() && prev_discriminant.unwrap_or(0) == u32::MAX {
|
||||
if variant.discriminant.is_none() && prev_discriminant == Some(u32::MAX) {
|
||||
let msg = format!("discriminant overflow on value after {}", u32::MAX);
|
||||
return Err(Error::new_spanned(variant, msg));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user