Skip to content

Commit 8dded8f

Browse files
authored
Fix clippy warning about operator precedence (#1280)
In Rust 1.85, Clippy started to warn about the precedence of `<<` and `|` in one of our use cases, although that lint was added before Rust 1.29. https://rust-lang.github.io/rust-clippy/master/index.html#precedence
1 parent 3832b0d commit 8dded8f

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/util/heap/space_descriptor.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ impl SpaceDescriptor {
3939
} else {
4040
start >> vm_layout().space_shift_64()
4141
};
42-
return SpaceDescriptor(
43-
space_index << INDEX_SHIFT
44-
| (if top {
45-
TYPE_CONTIGUOUS_HI
46-
} else {
47-
TYPE_CONTIGUOUS
48-
}),
49-
);
42+
let flags = if top {
43+
TYPE_CONTIGUOUS_HI
44+
} else {
45+
TYPE_CONTIGUOUS
46+
};
47+
return SpaceDescriptor((space_index << INDEX_SHIFT) | flags);
5048
}
5149
let chunks = (end - start) >> vm_layout::LOG_BYTES_IN_CHUNK;
5250
debug_assert!(!start.is_zero() && chunks > 0 && chunks < (1 << SIZE_BITS));

0 commit comments

Comments
 (0)