Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Made IO #[forbid(unsafe)] #749

Merged
merged 1 commit into from Jan 10, 2022
Merged

Made IO #[forbid(unsafe)] #749

merged 1 commit into from Jan 10, 2022

Conversation

jorgecarleitao
Copy link
Owner

This PR adds the bytemuck dependency and replaces all instances of unsafe in the IO module by bytemuck's API, also adding #[forbid(unsafe)] to make it more explicit that our IO has no unsafe on it.

It has no performance implications, it just formalizes (in traits) our use of plain old data (Pod) as defined in bytemuck.

Thanks to the wg secure code and in particular to @Shnatsel and @tarcieri for the recommendation that led to this PR, and also to the folks at #dark-arts for confirming that the two implementations of Pod in this PR are sound.

@jorgecarleitao jorgecarleitao added the enhancement An improvement to an existing feature label Jan 10, 2022
src/types/native.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Merging #749 (7c11d3e) into main (4c29966) will increase coverage by 0.01%.
The diff coverage is 93.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #749      +/-   ##
==========================================
+ Coverage   70.82%   70.84%   +0.01%     
==========================================
  Files         313      313              
  Lines       16931    16954      +23     
==========================================
+ Hits        11992    12011      +19     
- Misses       4939     4943       +4     
Impacted Files Coverage Δ
src/io/avro/mod.rs 66.66% <ø> (ø)
src/io/csv/mod.rs 0.00% <ø> (ø)
src/io/json/mod.rs 100.00% <ø> (ø)
src/types/native.rs 21.91% <ø> (ø)
src/io/parquet/read/primitive/utils.rs 87.50% <87.50%> (+14.77%) ⬆️
src/io/ipc/read/read_basic.rs 71.31% <100.00%> (+1.02%) ⬆️
src/io/ipc/write/serialize.rs 63.70% <100.00%> (-0.26%) ⬇️
src/io/parquet/read/primitive/basic.rs 68.68% <100.00%> (ø)
src/io/parquet/read/primitive/nested.rs 57.89% <100.00%> (ø)
src/io/parquet/read/nested_utils.rs 78.43% <0.00%> (+0.98%) ⬆️
... and 1 more

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 4c29966...7c11d3e. Read the comment docs.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement An improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants