Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark MutableBuffer::typed_data_mut unsafe #1029

Merged
merged 4 commits into from Dec 15, 2021

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Dec 11, 2021

Which issue does this PR close?

Closes #1027

Rationale for this change

Make the rust type annotations match the docstring about safety, and slightly decreasing the chance of misusing the apis in this crate

What changes are included in this PR?

  1. Mark MutableBuffer::typed_data_mut unsafe
  2. Annotate calls to MutableBuffer::typed_data_mut as unsafe and add justification

Are there any user-facing changes?

See subject

@alamb alamb added arrow Changes to the arrow crate api-change Changes to the arrow API labels Dec 11, 2021
@alamb
Copy link
Contributor Author

alamb commented Dec 11, 2021

FYI @jorgecarleitao and @jhorstmann

@github-actions github-actions bot added the parquet Changes to the parquet crate label Dec 11, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #1029 (f1f32a6) into master (e0abda2) will decrease coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1029      +/-   ##
==========================================
- Coverage   82.31%   82.31%   -0.01%     
==========================================
  Files         168      168              
  Lines       49031    49031              
==========================================
- Hits        40359    40358       -1     
- Misses       8672     8673       +1     
Impacted Files Coverage Δ
arrow/src/buffer/mutable.rs 89.47% <75.00%> (ø)
arrow/src/buffer/ops.rs 96.77% <100.00%> (ø)
arrow/src/compute/kernels/sort.rs 94.95% <100.00%> (ø)
arrow/src/compute/kernels/take.rs 95.21% <100.00%> (ø)
parquet/src/arrow/array_reader.rs 76.75% <100.00%> (ø)
parquet_derive/src/parquet_field.rs 65.75% <0.00%> (-0.46%) ⬇️
arrow/src/datatypes/datatype.rs 66.38% <0.00%> (+0.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0abda2...f1f32a6. Read the comment docs.

@alamb alamb merged commit f21fa54 into apache:master Dec 15, 2021
@alamb alamb deleted the alamb/typed_data_mut_not_safe branch December 15, 2021 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MutableBuffer::typed_data_mut is not safe
3 participants