Skip to content

Commit

Permalink
Fix namespace for asm! macro
Browse files Browse the repository at this point in the history
This commit removes the feature attribute asm and add a namespace for
the usage of the asm macro.

Currently the following build error is generated when using
rustc 1.66.0-nightly (c0983a9aa 2022-10-12):

$ cargo b
   Compiling drogue-boot v0.1.2 (/iot/drogue/drogue-boot)
error: cannot find macro `asm` in this scope
   --> src/lib.rs:100:9
    |
100 |         asm! {
    |         ^^^
    |
    = note: consider importing this macro:
            core::arch::asm

warning: the feature `asm` has been stable since 1.59.0 and no longer
requires an attribute to enable

 --> src/lib.rs:4:12
  |
4 | #![feature(asm)]
  |            ^^^
  |
  = note: `#[warn(stable_features)]` on by default

warning: `drogue-boot` (lib) generated 1 warning
error: could not compile `drogue-boot` due to previous error; 1 warning emitted

Refs: rust-lang/rust#84019

Signed-off-by: Daniel Bevenius <daniel.bevenius@gmail.com>
  • Loading branch information
danbev committed Oct 29, 2022
1 parent e9782fe commit 8a6e2c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// Licensed under the Apache-License 2.0

#![no_std]
#![feature(asm)]

#[cfg(feature = "rtt")]
pub mod rtt_logger;
Expand Down Expand Up @@ -97,7 +96,7 @@ extern "C" fn do_jump(_sp: u32, _reset: u32) -> ! {
// r1 = reset

unsafe {
asm! {
core::arch::asm! {
// Set the stack-pointer
"msr msp, r0",
// Branch to the reset handler.
Expand Down

0 comments on commit 8a6e2c6

Please sign in to comment.