Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modules implemented in Rust should build on stable Rust #18500

Closed
chrysn opened this issue Aug 23, 2022 · 1 comment · Fixed by #18678
Closed

Modules implemented in Rust should build on stable Rust #18500

chrysn opened this issue Aug 23, 2022 · 1 comment · Fixed by #18678
Assignees

Comments

@chrysn
Copy link
Member

chrysn commented Aug 23, 2022

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
@chrysn chrysn self-assigned this Aug 23, 2022
@chrysn
Copy link
Member Author

chrysn commented Aug 23, 2022

This might be fixed most easily once Rust 1.64 is used, as that has enhanced support for C-style strings.

chrysn added a commit to chrysn-pull-requests/RIOT that referenced this issue Aug 23, 2022
chrysn added a commit to chrysn-pull-requests/RIOT that referenced this issue Sep 26, 2022
chrysn added a commit to chrysn-pull-requests/RIOT that referenced this issue Oct 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant