Merge pull request #102 from Ralith/fix-flags-display

More robust Display for flags types
This commit is contained in:
Maik Klein 2018-08-23 07:08:32 +02:00 committed by GitHub
commit b84596fb9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1486 additions and 1486 deletions

File diff suppressed because it is too large Load diff

View file

@ -1515,7 +1515,7 @@ pub fn generate_const_displays<'a>(const_values: &HashMap<Ident, Vec<Ident>>) ->
let mut first = true;
let mut accum = value;
for (bit, name) in known {
if accum & bit != 0 {
if *bit != 0 && accum & *bit == *bit {
if !first { f.write_str(" | ")?; }
f.write_str(name)?;
first = false;