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
I was just checking how well my crates would play with the 2018 edition and I was able to work around most quirks except for a few with the most major probably being that it seems to be impossible to share peripherals via the good old Mutex<RefCell<Option<_>>> static mechanism due to the inavailability of const_fn:
error[E0015]: calls in statics are limited to tuple structs and tuple variants
--> examples/i2c_haldriver_printmagserial.rs:31:62
|
31 | static MAG3110: Mutex<RefCell<Option<Mag3110<I2c<TWI1>>>>> = Mutex::new(RefCell::new(None));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: a limited form of compile-time function evaluation is available on a nightly compiler via `const fn`
--> examples/i2c_haldriver_printmagserial.rs:31:62
|
31 | static MAG3110: Mutex<RefCell<Option<Mag3110<I2c<TWI1>>>>> = Mutex::new(RefCell::new(None));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is there any good workaround we can use here? Not being able to pass around peripherals and data safely into/out of interrupt handlers would be pretty bad, IMHO.
The text was updated successfully, but these errors were encountered:
25: Remove const-fn feature r=jonas-schievink a=rubberduck203
Per #22, as of Rust v1.31 const-fn was stablized.
Removing the feature in preparation of a 1.0 release.
Related to #11
Co-authored-by: Christopher J. McClellan <[email protected]>
I was just checking how well my crates would play with the 2018 edition and I was able to work around most quirks except for a few with the most major probably being that it seems to be impossible to share peripherals via the good old
Mutex<RefCell<Option<_>>>
static mechanism due to the inavailability ofconst_fn
:Is there any good workaround we can use here? Not being able to pass around peripherals and data safely into/out of interrupt handlers would be pretty bad, IMHO.
The text was updated successfully, but these errors were encountered: