- 
                Notifications
    You must be signed in to change notification settings 
- Fork 158
          Add unsafe block around DEVICE_PERIPHERALS = true in Peripherals::steal()
          #947
        
          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
  
    Add unsafe block around DEVICE_PERIPHERALS = true in Peripherals::steal()
  
  #947
              Conversation
4f40dba    to
    3d7e14c      
    Compare
  
    | 
 Make this, please. | 
3d7e14c    to
    e7ca4fb      
    Compare
  
    | 
 Done! | 
| Hm CI appears to be failing for reasons unrelated to these changes. Would you like me to make the fix as part of this PR anyway? | 
| Yes, try to fix it, please. | 
fa2e372    to
    a5ecffa      
    Compare
  
    | 
 Should be fixed now. Looks like this PR: rust-lang/rust#138907 merged  | 
| So svd2rust-regress completed locally for me with no errors, but during CI looks like it's failing because clippy is not installed. I'll see if I can update the workflow to ensure clippy is available during CI. | 
| cc @Emilgardis | 
| Looks like CI is passing now! Please let me know if there are any other changes you would like me to make. | 
37406df
    | 
 You could prepare PR for  | 
In edition 2024,
#[warn(unsafe_op_in_unsafe_fn)]is enabled by default.This PR adds the unsafe block around mutating
DEVICE_PERIPHERALSin the generatedPeripherals::steal()function. I had considered only adding this if the--edition=2024flag was passed, but there is no harm in this being here even for earlier editions and is IMO clearer regardless. Though if folks disagree I can make that change.