Skip to content

Commit 85d7e31

Browse files
Get miri working again after the #[start] attribute was removed
Just followed the suggestions from the compiler after removing the feature flag, seems to be failing for a sensible reason (can't call `furi_record_open`). rust-lang/rust#134299
1 parent a7588b1 commit 85d7e31

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

crates/flipperzero/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
//!
66
77
#![no_std]
8-
#![cfg_attr(all(test, not(miri)), no_main)]
9-
#![cfg_attr(all(test, miri), feature(start))]
8+
#![cfg_attr(test, no_main)]
109
#![cfg_attr(docsrs, feature(doc_cfg))]
1110
#![deny(rustdoc::broken_intra_doc_links)]
1211
#![warn(clippy::undocumented_unsafe_blocks)]

crates/test/macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ fn tests_runner_impl(args: TokenStream) -> parse::Result<TokenStream> {
142142
}
143143

144144
#[cfg(all(test, miri))]
145-
#[start]
146-
fn main(argc: isize, argv: *const *const u8) -> isize {
145+
#[unsafe(no_mangle)]
146+
fn miri_start(argc: isize, argv: *const *const u8) -> isize {
147147
// TODO: Is there any benefit to Miri in hooking up the binary arguments to
148148
// the test runner?
149149
let ret = __test_runner::main(None);

0 commit comments

Comments
 (0)