chore(core): remove unused trezor_lib/ui feature
What changed, and why it matters
This commit removes an unused Rust Cargo feature flag called 'ui' from the Trezor firmware build configuration. It is a cleanup change: the feature was always enabled in practice, so the code now compiles unconditionally. There is no security-relevant change to runtime behavior, no bug fix, and no vulnerability patch.
No security action required. Treat as routine maintenance/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit deletes the ‘trezor_lib/ui’ feature from default feature lists in bootloader, firmware, and prodtest Cargo.toml files, removes the ‘ui’ feature definition from core/embed/rust/Cargo.toml, and strips the corresponding #[cfg(feature = ‘ui’)] conditional compilation attributes from Rust source files. Because the feature was enabled in all relevant build profiles, this is a non-functional refactor that makes previously conditional modules and functions always compiled. No logic, interfaces, or security boundaries were modified.
Changed components
core/embed/projects/bootloader/Cargo.tomlcore/embed/projects/firmware/Cargo.tomlcore/embed/projects/prodtest/Cargo.tomlcore/embed/rust/Cargo.tomlcore/embed/rust/src/lib.rscore/embed/rust/src/trezorhal/ble/mod.rscore/embed/rust/src/trezorhal/mod.rscore/embed/rust/src/trezorhal/power_manager.rsInspect captured patch +2 / −15
### core/embed/projects/bootloader/Cargo.toml
@@ -111,7 +111,6 @@ default = [
"crypto/ed25519_no_precomp",
"trezor_lib/crypto",
- "trezor_lib/ui",
"trezor_lib/bootloader",
"trezor_lib/usb",
]
### core/embed/projects/firmware/Cargo.toml
@@ -164,7 +164,6 @@ default = [
"trezor_lib/crypto",
"trezor_lib/micropython",
"trezor_lib/protobuf",
- "trezor_lib/ui",
"trezor_lib/storage",
"trezor_lib/translations",
"trezor_lib/usb",
### core/embed/projects/prodtest/Cargo.toml
@@ -126,7 +126,6 @@ default = [
"crypto/noise",
"trezor_lib/crypto",
- "trezor_lib/ui",
"trezor_lib/prodtest",
"trezor_lib/usb",
]
### core/embed/rust/Cargo.toml
@@ -96,7 +96,6 @@ touch = []
touch_wakeup = []
translations = ["crypto"]
tropic = []
-ui = []
ui_antialiasing = []
ui_blurring = []
ui_color_32bit = []
@@ -157,7 +156,6 @@ test = [
"ui_image_buffer",
"ui_jpeg",
"ui_overlay",
- "ui",
"universal_fw",
]
### core/embed/rust/src/lib.rs
@@ -20,7 +20,7 @@
),
feature(lang_items)
)]
-#![cfg_attr(all(feature = "ui", feature = "layout_bolt"), feature(trait_alias))]
+#![cfg_attr(feature = "layout_bolt", feature(trait_alias))]
#[macro_use]
extern crate num_derive;
@@ -54,7 +54,6 @@ mod trezorhal;
// mod ui is `pub` because of the re-export pattern in individual models, which
// would trigger a brickload of "unused symbol" warnings otherwise.
// TODO: maybe get rid of the re-export pattern :shrugs:
-#[cfg(feature = "ui")]
pub mod ui;
pub mod util;
### core/embed/rust/src/trezorhal/ble/mod.rs
@@ -5,7 +5,6 @@ use core::ptr;
use super::ffi;
use crate::trezorhal::ffi::bt_le_addr_t;
-#[cfg(feature = "ui")]
use crate::ui::event::BLEEvent;
pub const ADV_NAME_LEN: usize = ffi::BLE_ADV_NAME_LEN as usize;
@@ -32,7 +31,6 @@ pub fn res_to_result(res: bool) -> Result<(), BleError> {
}
}
-#[cfg(feature = "ui")]
pub fn ble_parse_event(event: ffi::ble_event_t) -> BLEEvent {
match event.type_ {
ffi::ble_event_type_t_BLE_CONNECTED => BLEEvent::Connected,
### core/embed/rust/src/trezorhal/mod.rs
@@ -1,9 +1,7 @@
pub mod bip39;
-#[cfg(feature = "ui")]
pub mod bitblt;
#[cfg(feature = "ble")]
pub mod ble;
-#[cfg(feature = "ui")]
pub mod display;
mod ffi;
#[cfg(feature = "haptic")]
@@ -15,7 +13,7 @@ pub mod button;
#[cfg(feature = "touch")]
pub mod touch;
-#[cfg(all(feature = "ui", feature = "hw_jpeg_decoder"))]
+#[cfg(feature = "hw_jpeg_decoder")]
pub mod jpegdec;
pub mod model;
pub mod random;
@@ -32,7 +30,6 @@ pub mod wordlist;
pub mod secbool;
-#[cfg(feature = "ui")]
pub mod sysevent;
#[cfg(feature = "power_manager")]
### core/embed/rust/src/trezorhal/power_manager.rs
@@ -1,7 +1,6 @@
use core::ptr::null_mut;
use super::ffi;
-#[cfg(feature = "ui")]
use crate::ui::event::PMEvent;
#[derive(Copy, Clone)]
@@ -11,7 +10,6 @@ pub enum ChargingState {
Idle,
}
-#[cfg(feature = "ui")]
pub fn pm_parse_event(event: ffi::pm_event_t) -> PMEvent {
let mut pm_event = PMEvent::default();
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.