Skip to content

Replace unsafe MaybeUninit array initialization - #80

Merged
Kronos3 merged 1 commit into
nasa:mainfrom
chise0713:unsafe_uninit_array_init
Jul 14, 2026
Merged

Replace unsafe MaybeUninit array initialization#80
Kronos3 merged 1 commit into
nasa:mainfrom
chise0713:unsafe_uninit_array_init

Conversation

@chise0713

@chise0713 chise0713 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Replace

    unsafe { MaybeUninit::uninit().assume_init() }

with

    [const { MaybeUninit::uninit() }; N]

This removes two unnecessary unsafe blocks while preserving the same behavior.

And the project's MSRV (Rust 1.87) supports this initialization pattern.

Reference: rust-lang/rust RELEASES.md#version-1790-2024-06-13 rust-lang/rust#104087

AI disclosure: ChatGPT was used to look up when const array initialization ([const { ... }; N]) became available and to confirm that it is supported by the project's MSRV. The code change was implemented, reviewed, and tested manually.

@github-actions

Copy link
Copy Markdown

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly

@github-actions

Copy link
Copy Markdown

CoreMark Benchmark Results

Current Score: 242.974
Baseline Score (main): 261.142
Difference: -18.168 (-6.96%)

@github-actions

Copy link
Copy Markdown

Code Coverage Report

Current Coverage: 94.78%
Baseline Coverage (main): 94.73%
Difference: +0.05%

@Kronos3 Kronos3 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@Kronos3
Kronos3 merged commit 1263a63 into nasa:main Jul 14, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants