Skip to content

Modules implemented in Rust should build on stable Rust #18500

@chrysn

Description

@chrysn

We have (and test) two general purpose modules that can be generally useful -- the lsm303agr driver and the shell demo commands. As these (especially lsm303agr) can be pulled into applications without the author's awareness of Rust, these should be held to the the highest standards of stability, and the tests/rust_libs test should be executed on stable.

This is an issue and not a PR yet because while most of this would be straightforward (setting riot-wrappers to default-features to false), but something in the shell commands appears to depend on something:

error[E0015]: cannot call non-const fn `riot_wrappers::cstr_core::CStr::from_bytes_with_nul_unchecked` in statics
 --> /home/chrysn/git/RIOT/sys/shell/democommands/src/lib.rs:6:1
  |
6 | riot_wrappers::static_command!(static_hello_world, "hello_world", "Print a greeting", hello_world);
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: calls in statics are limited to constant functions, tuple structs and tuple variants
  = note: this error originates in the macro `$crate::cstr::cstr` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0015`.
error: could not compile `riot-module-shell-democommands` due to 2 previous errors

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions