You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
180: Fix test errors. r=korken89 a=ehuss
Upstream rust-lang/rust requires `mdbook test` to pass. See rust-lang/rust#59366 (comment)
Co-authored-by: Eric Huss <eric@huss.org>
Copy file name to clipboardExpand all lines: src/interoperability/c-with-rust.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,7 +120,7 @@ For projects with limited dependencies or complexity, or for projects where it i
120
120
121
121
In the simplest case of compiling a single C file as a dependency to a static library, an example `build.rs` script using the [`cc` crate] would look like this:
This structure allows us to obtain a single instance of our peripheral. If we try to call `take_serial()` more than once, our code will panic!
46
46
47
-
```rust
47
+
```rust,ignore
48
48
fn main() {
49
49
let serial_1 = unsafe { PERIPHERALS.take_serial() };
50
50
// This panics!
@@ -60,7 +60,7 @@ This has a small runtime overhead because we must wrap the `SerialPort` structur
60
60
61
61
Although we created our own `Peripherals` structure above, it is not necessary to do this for your code. the `cortex_m` crate contains a macro called `singleton!()` that will perform this action for you.
62
62
63
-
```rust
63
+
```rust,ignore
64
64
#[macro_use(singleton)]
65
65
extern crate cortex_m;
66
66
@@ -116,7 +116,7 @@ There are two important factors in play here:
116
116
117
117
These two factors put together means that it is only possible to access the hardware if we have appropriately satisfied the borrow checker, meaning that at no point do we have multiple mutable references to the same hardware!
0 commit comments