Skip to content

Conversation

@nicholasbishop
Copy link
Contributor

std::env::remove_var does not say that deleting a nonexistent variable is an error (and at least on Linux, it indeed does not cause an error).

The UEFI Shell Protocol spec also doesn't say it's an error, but the edk2 implementation delegates to the UEFI runtime SetVariable function, which returns EFI_NOT_FOUND when trying to delete a nonexistent variable.

Change the UEFI implementation to check for a NotFound error and treat it as success.

CC @Ayush1325

`std::env::remove_var` does not say that deleting a nonexistent variable
is an error (and at least on Linux, it indeed does not cause an
error).

The UEFI Shell Protocol spec also doesn't say it's an error, but the
edk2 implementation delegates to the UEFI runtime `SetVariable`
function, which returns `EFI_NOT_FOUND` when trying to delete a
nonexistent variable.

Change the UEFI implementation to check for a `NotFound` error and treat
it as success.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 8, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 8, 2026

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from ChrisDenton, Mark-Simulacrum

@joboet
Copy link
Member

joboet commented Feb 9, 2026

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 9, 2026

📌 Commit 4d07a8f has been approved by joboet

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 9, 2026
@joboet joboet assigned joboet and unassigned ChrisDenton Feb 9, 2026
rust-bors bot pushed a commit that referenced this pull request Feb 9, 2026
Rollup of 3 pull requests

Successful merges:

 - #152357 (std: Don't panic when removing a nonexistent UEFI var)
 - #152180 (Port `rustc_reservation_impl` to the new attribute parser)
 - #152276 (Add message format checking)
@rust-bors rust-bors bot merged commit e046884 into rust-lang:main Feb 9, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 9, 2026
rust-timer added a commit that referenced this pull request Feb 9, 2026
Rollup merge of #152357 - nicholasbishop:push-uolpvnvrlznw, r=joboet

std: Don't panic when removing a nonexistent UEFI var

`std::env::remove_var` does not say that deleting a nonexistent variable is an error (and at least on Linux, it indeed does not cause an error).

The UEFI Shell Protocol spec also doesn't say it's an error, but the edk2 implementation delegates to the UEFI runtime `SetVariable` function, which returns `EFI_NOT_FOUND` when trying to delete a nonexistent variable.

Change the UEFI implementation to check for a `NotFound` error and treat it as success.

CC @Ayush1325
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants