Skip to content

Commit 3abf4e6

Browse files
committed
Merge branch 'rust-1.68'
2 parents e4dbcbb + b38865a commit 3abf4e6

File tree

13 files changed

+466
-379
lines changed

13 files changed

+466
-379
lines changed

.ci/run-container-ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
set -e
2626
set -x
2727

28-
CONTAINER=shiftcrypto/firmware_v2:31
28+
CONTAINER=shiftcrypto/firmware_v2:32
2929

3030
if [ "$1" == "pull" ] ; then
3131
docker pull "$CONTAINER"

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ RUN rustup component add clippy
132132
RUN CARGO_HOME=/opt/cargo cargo install cbindgen --version 0.24.3
133133
RUN CARGO_HOME=/opt/cargo cargo install bindgen-cli --version 0.64.0
134134

135-
COPY tools/prost-build prost-build
136-
RUN CARGO_HOME=/opt/cargo cargo install --path prost-build --locked
135+
COPY tools/prost-build-proto prost-build-proto
136+
RUN CARGO_HOME=/opt/cargo cargo install --path prost-build-proto --locked
137137

138138
# Clean temporary files to reduce image size
139139
RUN rm -rf /var/lib/apt/lists/*

messages/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ foreach(i ${PROTO_FILES})
1919
list(APPEND PROTO_FILES_ABSOLUTE "${CMAKE_CURRENT_SOURCE_DIR}/${i}")
2020
endforeach()
2121

22-
find_program(PROST_BUILD prost-build)
22+
find_program(PROST_BUILD prost-build-proto)
2323

2424
set(OUTPUT_FILES
2525
${CMAKE_SOURCE_DIR}/src/rust/bitbox02-rust/src/shiftcrypto.bitbox02.rs

src/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -408,10 +408,6 @@ if(NOT CMAKE_CROSSCOMPILING)
408408
COMMAND
409409
${CMAKE_COMMAND} -E env
410410
CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}
411-
# enable nightly features in the stable release - needed to activate alloc_error_handler.
412-
# see src/rust/bitbox02-rust-c/src/lib.rs.
413-
# https://github.com/rust-lang/rust/issues/66740
414-
RUSTC_BOOTSTRAP=1
415411
FIRMWARE_VERSION_SHORT=${FIRMWARE_VERSION}
416412
# only one test thread because of unsafe concurrent access to `SafeData`, `mock_sd()` and `mock_memory()`. Using mutexes instead leads to mutex poisoning and very messy output in case of a unit test failure.
417413
${CARGO} test $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-v> --all-features --target-dir ${RUST_BINARY_DIR}/all-features ${RUST_CARGO_FLAG} -- --nocapture --test-threads 1
@@ -426,10 +422,6 @@ if(NOT CMAKE_CROSSCOMPILING)
426422
COMMAND
427423
${CMAKE_COMMAND} -E env
428424
CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}
429-
# enable nightly features in the stable release - needed to activate alloc_error_handler.
430-
# see src/rust/bitbox02-rust-c/src/lib.rs.
431-
# https://github.com/rust-lang/rust/issues/66740
432-
RUSTC_BOOTSTRAP=1
433425
FIRMWARE_VERSION_SHORT=${FIRMWARE_VERSION}
434426
${CARGO} clippy
435427
$<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-v>
@@ -505,10 +497,6 @@ foreach(type ${RUST_LIBS})
505497
${CMAKE_COMMAND} -E env
506498
CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}
507499
RUSTFLAGS=${RUSTFLAGS}
508-
# enable nightly features in the stable release - needed to activate alloc_error_handler.
509-
# see src/rust/bitbox02-rust-c/src/lib.rs.
510-
# https://github.com/rust-lang/rust/issues/66740
511-
RUSTC_BOOTSTRAP=1
512500
FIRMWARE_VERSION_SHORT=${FIRMWARE_VERSION}
513501
${CARGO} build $<$<BOOL:${CMAKE_VERBOSE_MAKEFILE}>:-v> --features target-${type} --target-dir ${RUST_BINARY_DIR}/feature-${type} ${RUST_CARGO_FLAG} ${RUST_TARGET_ARCH_ARG}
514502
COMMAND
@@ -532,10 +520,6 @@ if(CMAKE_CROSSCOMPILING)
532520
add_custom_target(rust-docs
533521
COMMAND
534522
${CMAKE_COMMAND} -E env
535-
# enable nightly features in the stable release - needed to activate alloc_error_handler.
536-
# see src/rust/bitbox02-rust-c/src/lib.rs.
537-
# https://github.com/rust-lang/rust/issues/66740
538-
RUSTC_BOOTSTRAP=1
539523
FIRMWARE_VERSION_SHORT=${FIRMWARE_VERSION}
540524
CMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}
541525
SYSROOT=${CMAKE_SYSROOT}

src/rust/bitbox02-rust-c/src/alloc.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,6 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#[alloc_error_handler]
16-
#[cfg(not(test))]
17-
#[cfg(not(feature = "testing"))]
18-
// Function name is arbitrary.
19-
fn bitbox02_alloc_error_handler(layout: core::alloc::Layout) -> ! {
20-
panic!("memory allocation of {} bytes failed", layout.size())
21-
}
22-
2315
struct BB02Allocator;
2416

2517
extern "C" {

src/rust/bitbox02-rust-c/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// limitations under the License.
1414

1515
#![no_std]
16-
#![feature(alloc_error_handler)] // used in alloc.rs
17-
#![feature(lang_items)]
1816

1917
#[cfg(test)]
2018
#[macro_use]

src/rust/bitbox02/src/ui/types.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ pub use bitbox02_sys::trinary_choice_t as TrinaryChoice;
2323
#[cfg_attr(feature = "testing", allow(dead_code))]
2424
pub(crate) const MAX_LABEL_SIZE: usize = bitbox02_sys::MAX_LABEL_SIZE as _;
2525

26+
#[derive(Default)]
2627
pub enum Font {
28+
#[default]
2729
Default,
2830
Password11X12,
2931
Monogram5X9,
@@ -40,12 +42,6 @@ impl Font {
4042
}
4143
}
4244

43-
impl Default for Font {
44-
fn default() -> Self {
45-
Font::Default
46-
}
47-
}
48-
4945
#[derive(Default)]
5046
pub struct ConfirmParams<'a> {
5147
/// The confirmation title of the screen. Max 200 chars, otherwise **panic**.

src/rust/rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.67.1
1+
1.68.0
File renamed without changes.

0 commit comments

Comments
 (0)