Skip to content

Comments

[Coding Rule]: Do not read from uninitialized union fields#302

Merged
PLeVasseur merged 11 commits intorustfoundation:mainfrom
rcseacord:patch-3
Feb 9, 2026
Merged

[Coding Rule]: Do not read from uninitialized union fields#302
PLeVasseur merged 11 commits intorustfoundation:mainfrom
rcseacord:patch-3

Conversation

@rcseacord
Copy link
Collaborator

…alized bytes

gui_UnionPartialInit
Do not read from union fields that may contain uninitialized bytes

@netlify
Copy link

netlify bot commented Dec 16, 2025

Deploy Preview for scrc-coding-guidelines ready!

Name Link
🔨 Latest commit a113eb6
🔍 Latest deploy log https://app.netlify.com/projects/scrc-coding-guidelines/deploys/6983a3fdc557e10008aba254
😎 Deploy Preview https://deploy-preview-302--scrc-coding-guidelines.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@felix91gr
Copy link
Collaborator

What's the difference in intent between this one and #300? This one has the title I would like #300 to have, but this one in particular I haven't read yet.

@rcseacord
Copy link
Collaborator Author

What's the difference in intent between this one and #300? This one has the title I would like #300 to have, but this one in particular I haven't read yet.

@felix91gr the other one is for validity checks. this one is for reading uninitialized.

Copy link

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

Noticed some sharp edges in the text.

rcseacord and others added 4 commits January 19, 2026 14:01
…alized bytes

gui_UnionPartialInit 
Do not read from union fields that may contain uninitialized bytes
add new guideline
Clarify rules for accessing struct fields and typed reads.
Standardize IDs and bibliography entries, update example miri/warning handling, and add missing tag definitions for unions/initialization.
@github-actions
Copy link
Contributor

👋 Hey @Dillonmcewan! You've been assigned to review this coding guideline PR.

Your Role as Reviewer

As outlined in our contribution guide, please:

  1. Begin your review within 14 days
  2. Provide constructive feedback on the guideline content, examples, and formatting
  3. Iterate with @rcseacord - they may update the PR based on your feedback
  4. When the guideline is ready, approve and add to the merge queue

Review Checklist

  • Guideline title is clear and follows conventions
  • Amplification section expands on the title appropriately
  • Rationale explains the "why" effectively
  • Non-compliant example(s) clearly show the problem
  • Compliant example(s) clearly show the solution
  • Code examples compile (check the CI results)
  • FLS paragraph ID is correct

Bot Commands

If you need to pass this review:

  • @guidelines-bot /pass [reason] - Pass just this PR to the next reviewer
  • @guidelines-bot /away YYYY-MM-DD [reason] - Step away from the queue until a date
  • @guidelines-bot /release [@username] [reason] - Release assignment (yours or someone else's with triage+ permission)

To assign someone else:

  • @guidelines-bot /r? @username - Assign a specific reviewer
  • @guidelines-bot /r? producers - Request the next reviewer from the queue

Other commands:

  • @guidelines-bot /claim - Claim this review for yourself
  • @guidelines-bot /label +label-name - Add a label
  • @guidelines-bot /label -label-name - Remove a label
  • @guidelines-bot /queue - Show reviewer queue
  • @guidelines-bot /commands - Show all available commands

@rcseacord rcseacord marked this pull request as ready for review January 20, 2026 15:49
Copy link
Contributor

@Dillonmcewan Dillonmcewan left a comment

Choose a reason for hiding this comment

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

Generally looks great! Noticed one minor formatting issue and had one question about some non-compliant examples

Copy link
Contributor

@Dillonmcewan Dillonmcewan left a comment

Choose a reason for hiding this comment

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

LGTM!

@rcseacord rcseacord requested a review from PLeVasseur January 21, 2026 20:26
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2026

⚠️ Review Reminder

Hey @Dillonmcewan, it's been more than 14 days since you were assigned to review this.

Please take one of the following actions:

  1. Begin your review - Post a comment with your feedback
  2. Pass the review - Use @guidelines-bot /pass [reason] to assign the next reviewer
  3. Step away temporarily - Use @guidelines-bot /away YYYY-MM-DD [reason] if you need time off

If no action is taken within 14 days, you may be transitioned from Producer to Observer status per our contribution guidelines.

Life happens! If you're dealing with something, just let us know.

Copy link
Contributor

@Dillonmcewan Dillonmcewan left a comment

Choose a reason for hiding this comment

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

Didn't seem to register my last approval. Trying again

@Dillonmcewan
Copy link
Contributor

@PLeVasseur Is there something else I need to do to appease the bot? I approved the PR, but it still flagged me as having not reviewed

@PLeVasseur
Copy link
Collaborator

@PLeVasseur Is there something else I need to do to appease the bot? I approved the PR, but it still flagged me as having not reviewed

Apologies @Dillonmcewan -- there's a bug / not well defined workflow here. Still working to resolve this. Will respond here once fixed. 🙃

@felix91gr
Copy link
Collaborator

@Dillonmcewan to keep you in the loop: an issue to fix this has been opened #388 :)

@PLeVasseur
Copy link
Collaborator

@Dillonmcewan -- I hope I was able to get this fixed, see PR here: #391

Could you try to approve again to see if it'll take?

Copy link
Contributor

@Dillonmcewan Dillonmcewan left a comment

Choose a reason for hiding this comment

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

LGTM again!

@felix91gr
Copy link
Collaborator

@PLeVasseur I think we have PR merging blocked unless approval is given by members with write access.

But I have 2 reasons to think that perhaps this isn't getting merged because the bot isn't picking up on the approving review:

  1. The bot hasn't given its characteristic 👀 and 👍 reactions to Dillon's approving comment.
  2. I just looked at 📊 Reviewer Bot State (DO NOT CLOSE) #314 and I saw this:
active_reviews:
  (... other stuff...)
  '302':
    skipped: []
    current_reviewer: Dillonmcewan
    assigned_at: '2026-01-19T06:05:28.171437+00:00'
    last_reviewer_activity: '2026-02-03T04:17:12.540512+00:00'
    transition_warning_sent: null
    assignment_method: round-robin

And the last_reviewer_activity strikes me as odd. If the bot had done something, it would've been updated to something along the lines of '2026-02-05', right?

@PLeVasseur
Copy link
Collaborator

Sorry folks :(

Let me try again @Dillonmcewan

Testing in production 🫠

@Dillonmcewan
Copy link
Contributor

No worries. These github integrations are always tricky to get right without fiddling around in prod. Let me know if there's anything I can do to help

@PLeVasseur
Copy link
Collaborator

@guidelines-bot /rectify

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

✅ Rectified PR #302: latest review by @Dillonmcewan is APPROVED; marked review complete.

Copy link
Collaborator

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

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

Approving so we can merge. Thank you for the patience @Dillonmcewan :)

'302':                                                                                     
  skipped: []                                                                              
  current_reviewer: Dillonmcewan                                                           
  assigned_at: '2026-01-19T06:05:28.171437+00:00'                                          
  last_reviewer_activity: '2026-02-09T18:39:37.786801+00:00'                               
  transition_warning_sent: null                                                            
  assignment_method: round-robin                                                           
  review_completed_at: '2026-02-09T18:39:37.786801+00:00'                                  
  review_completed_by: Dillonmcewan                                                        
  review_completion_source: rectify:reconcile-pr-review                                   

Source: #314

@PLeVasseur PLeVasseur added this pull request to the merge queue Feb 9, 2026
Merged via the queue into rustfoundation:main with commit f1352df Feb 9, 2026
16 checks passed
@PLeVasseur
Copy link
Collaborator

🎉

@felix91gr
Copy link
Collaborator

🎉

@PLeVasseur
Copy link
Collaborator

Was a little rough this time, but seems like it should work next time! ☺️
#402 (comment)

@PLeVasseur PLeVasseur deleted the patch-3 branch February 10, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chapter: types-and-traits coding guideline An issue related to a suggestion for a coding guideline

Development

Successfully merging this pull request may close these issues.

5 participants