Skip to content

Commit

Permalink
Fix distributed slice inside #[cortex_m_rt::entry] macro
Browse files Browse the repository at this point in the history
Required because cortex-m-rt is stuck on an old version of syn.

    error: free static item without body
      --> tests/cortex/src/main.rs:36:5
       |
    36 |     static EMPTY: [i32];
       |     ^^^^^^^^^^^^^^^^^^^-
       |                        |
       |                        help: provide a definition for the static: `= <expr>;`

    error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
      --> tests/cortex/src/main.rs:36:19
       |
    36 |     static EMPTY: [i32];
       |                   ^^^^^ doesn't have a size known at compile-time
       |
       = help: the trait `Sized` is not implemented for `[i32]`
  • Loading branch information
dtolnay committed Oct 11, 2023
1 parent 77a71b8 commit a26932c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/cortex/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn main() -> ! {
assert_eq!(sum, 9 + 99 + 999);

#[distributed_slice]
static EMPTY: [i32];
static EMPTY: [i32] = [..];

assert!(EMPTY.is_empty());

Expand Down

0 comments on commit a26932c

Please sign in to comment.