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

Survey: unstable features you routinely (have to) use #31

Closed
japaric opened this issue Jun 16, 2017 · 15 comments
Closed

Survey: unstable features you routinely (have to) use #31

japaric opened this issue Jun 16, 2017 · 15 comments
Labels
feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 survey

Comments

@japaric
Copy link
Member

japaric commented Jun 16, 2017

This goal of this survey is to get an idea of what (currently) unstable Rust features would need to be stabilized to make embedded development feasible on the stable channel.

One unstable feature per comment. If an unstable feature you use is already listed in the comments up vote it (:+1: reaction) so we can track the number of users that feature has.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

Xargo

Yup, Xargo only works with the nightly / dev channel because compiling the core crate requires a bunch of unstable features; some of them will probably never become stable.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

#[lang_item = "panic_fmt"] (#![feature(lang_items)])

Required to build no_std Rust binaries. If you are building a binary crate that contains #![no_std] then something in you dependency graph is providing this.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

extern crate compiler_builtins (#![feature(compiler_builtins)])

Provides softwae implementation of operations that don't directly map to hardware like floating point operations on the Cortex-M3 or 64-bit mulitplication on 32-bit architectures. If you have something like this:

[dependencies.compiler_builtins]
features = ["mem"]
git = "https://github.com/rust-lang-nursery/compiler-builtins"
stage = 1

in your Xargo.toml file then you are indirectly using this feature.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

asm!() (#![feature(asm)])

If you are using the API in cortex_m::asm then you are indirectly using this feature.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

#[linkage = "weak"] (#![feature(linkage)])

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

#[naked] (#![feature(naked_functions)])

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

#[used] (#![feature(used)])

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

const fn foo() (#![feature(const_fn)])

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

core::intrinsics (#![feature(core_intrinsics)])

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

global_asm!() (#![feature(global_asm)])

@japaric japaric added the survey label Jun 16, 2017
@coder543
Copy link

coder543 commented Jun 16, 2017

(note that this is just my opinion, maybe others disagree)

Just being able to build even the tiniest, most incomplete functional firmware in Rust completely using the stable toolchain is the first step. Anything else is secondary, but a lot of those secondary items are important. Specifically, that primarily means lang_items, I think. For practical embedded usage, the standard asm! macro is the very next thing on the list.

Everything on this informal survey is definitely useful to embedded developers. However, as an example, stabilizing weak linkage will not get anyone closer to compiling a minimal embedded example with the stable toolchain if lang_item is not available, so I feel like the very most important stuff on this list is already a known factor.

@japaric
Copy link
Member Author

japaric commented Jun 16, 2017

@coder543 I agree with everything you said. We, embedded developers, know what's required for "being able to build even the tiniest, most incomplete functional firmware in Rust completely using the stable toolchain" and what's "the very next thing on the list" but the Rust team doesn't -- they are not embedded developers. That's where this survey can help. I can tell (and I already have) the Rust team that the number one blocker for stable no-std application development is the panic_fmt lang item, but if I add "and 100% of N developers agree" to the message then that adds a sense of urgency.

@japaric
Copy link
Member Author

japaric commented Jul 20, 2017

PSA: rust-lang/rfcs#2070 proposes a stable mechanism to specify the behavior of panic! in no-std context; this mechanism would supersede the unstable panic_fmt lang item.

cc @adamgreig @therealprof @coder543 @pftbest @parched @Michael-F-Bryan @lexxvir @cmerrill

@jamesmunns
Copy link
Member

I think we met most of these goals, or have opened follow on issues for most items listed here. Nominating this to be closed.

@jamesmunns jamesmunns added the feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 label Feb 4, 2019
@jamesmunns
Copy link
Member

I am closing this issue, please feel free to open another issue if you would like this discussed further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feb-2019-cleanup These issues are proposed to be closed, as part of a cleanup of issues in February 2019 survey
Projects
None yet
Development

No branches or pull requests

3 participants