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

UefiHidDxeV2: Remove mutable static shared reference #593

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

makubacki
Copy link
Member

Description

Use addr_of!() (raw pointer) to prevent a reference being created to the mutable static variable.

  = note: this will be a hard error in the 2024 edition
  = note: this shared reference has lifetime `'static`, but if the
          static ever gets mutated, or a mutable reference is
		  created, then any further use of this shared reference is
		  Undefined Behavior
  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • Cargo clippy and build

Integration Instructions

  • N/A

@makubacki makubacki added the semver:patch Pull requests that should increment the release patch version label Oct 1, 2024
@makubacki makubacki self-assigned this Oct 1, 2024
@github-actions github-actions bot added the impact:non-functional Does not have a functional impact label Oct 1, 2024
@makubacki makubacki force-pushed the uefihiddxev2_addrof branch from 2acd5ab to 69b4a00 Compare October 1, 2024 18:50
@makubacki makubacki enabled auto-merge (squash) October 1, 2024 18:50
Copy link

This PR has been automatically marked as stale because it has not had activity in 60 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label Nov 30, 2024
@makubacki makubacki force-pushed the uefihiddxev2_addrof branch from 69b4a00 to a48d1bf Compare December 3, 2024 18:44
@makubacki makubacki removed the state:stale Has not been updated in a long time label Dec 3, 2024
Use `addr_of!()` (raw pointer) to prevent a reference being created
to the mutable static variable.

```
  = note: this will be a hard error in the 2024 edition
  = note: this shared reference has lifetime `'static`, but if the
          static ever gets mutated, or a mutable reference is
		  created, then any further use of this shared reference is
		  Undefined Behavior
```

Signed-off-by: Michael Kubacki <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 11.59%. Comparing base (184d495) to head (af71887).
Report is 1 commits behind head on dev/202405.

Additional details and impacted files
@@             Coverage Diff             @@
##           dev/202405     #593   +/-   ##
===========================================
  Coverage       11.59%   11.59%           
===========================================
  Files             132      132           
  Lines           21561    21561           
  Branches         2546     2546           
===========================================
  Hits             2499     2499           
  Misses          19028    19028           
  Partials           34       34           
Flag Coverage Δ
HidPkg 2.80% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@makubacki makubacki merged commit 9232759 into microsoft:dev/202405 Dec 20, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact:non-functional Does not have a functional impact semver:patch Pull requests that should increment the release patch version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants