Skip to content

fix(ast_tools): fix calculation of number of bytes required for Derives bitmap#10222

Merged
graphite-app[bot] merged 1 commit intomainfrom
04-04-fix_ast_tools_fix_calculation_of_number_of_bytes_required_for_derives_bitmap
Apr 4, 2025
Merged

fix(ast_tools): fix calculation of number of bytes required for Derives bitmap#10222
graphite-app[bot] merged 1 commit intomainfrom
04-04-fix_ast_tools_fix_calculation_of_number_of_bytes_required_for_derives_bitmap

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Apr 4, 2025

#10196 changed this line:

- const NUM_BYTES: usize = (DERIVES.len() + 7) / 8;
+ const NUM_BYTES: usize = (DERIVES.len() + 7).div_ceil(8);

But that's not equivalent. The correct version with div_ceil is:

const NUM_BYTES: usize = DERIVES.len().div_ceil(8);

Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-ast-tools Area - AST tools C-bug Category - Bug labels Apr 4, 2025
@overlookmotel overlookmotel marked this pull request as ready for review April 4, 2025 11:00
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Apr 4, 2025
Copy link
Member

Boshen commented Apr 4, 2025

Merge activity

…ves` bitmap (#10222)

#10196 changed this line:

```diff
- const NUM_BYTES: usize = (DERIVES.len() + 7) / 8;
+ const NUM_BYTES: usize = (DERIVES.len() + 7).div_ceil(8);
```

But that's not equivalent. The correct version with `div_ceil` is:

```rs
const NUM_BYTES: usize = DERIVES.len().div_ceil(8);
```
@graphite-app graphite-app bot force-pushed the 04-04-fix_ast_tools_fix_calculation_of_number_of_bytes_required_for_derives_bitmap branch from 12f50fe to fa5f991 Compare April 4, 2025 11:12
@graphite-app graphite-app bot merged commit fa5f991 into main Apr 4, 2025
17 checks passed
@graphite-app graphite-app bot deleted the 04-04-fix_ast_tools_fix_calculation_of_number_of_bytes_required_for_derives_bitmap branch April 4, 2025 11:19
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast-tools Area - AST tools C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants