You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to bring up my stm32f429i-eval board which has a TFT screen per default. I adapted the example from the HAL to implement it; but I get this warning when compiling:
--> examples/ltdc-screen.rs:107:43
|
107 | .config_layer(Layer::L1, unsafe { &mut FB_LAYER1 }, PixelFormat::RGB565);
| ^^^^^^^^^^^^^^ mutable reference to mutable static
|
= note: for more information, see issue #114447 rust-lang/rust#114447
= note: this will be a hard error in the 2024 edition
= note: this mutable reference has lifetime 'static, but if the static gets accessed (read or written) by any other means, or any other reference is created, then any further use of this mutable reference is Undefined Behavior
= note: #[warn(static_mut_refs)] on by default
help: use addr_of_mut! instead to create a raw pointer
|
107 | .config_layer(Layer::L1, unsafe { addr_of_mut!(FB_LAYER1) }, PixelFormat::RGB565);
| ~~~~~~~~~~~~~~~~~~~~~~~
Any ideas how to avoid it? I've tried several methods, but none worked as either the solution tried to supply a raw pointer to the config_layer (addr_of_mut), or the static lifetime disappeared.
Since it says this will be a hard error in 2024, I kind of want the warning to be gone. :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to bring up my stm32f429i-eval board which has a TFT screen per default. I adapted the example from the HAL to implement it; but I get this warning when compiling:
Any ideas how to avoid it? I've tried several methods, but none worked as either the solution tried to supply a raw pointer to the config_layer (addr_of_mut), or the static lifetime disappeared.
Since it says this will be a hard error in 2024, I kind of want the warning to be gone. :)
Beta Was this translation helpful? Give feedback.
All reactions