-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Stabilize #![no_std] #1005
Comments
I think the main use case is kernels / bare metal, or any other new platform where you haven't ported |
Yes, mostly kernels, embedded systems, and other uses where there's no full-fledged We should approach this the other way around. Let's first assume Rust doesn't import any runtime crates by default at all (no But most developers don't want to choose their runtime, so we should set sensible defaults. The compiler imports And then the purpose of Therefore my opinion is that the attribute should be renamed to |
Another use case that is important to Rust implementers: Truly minimal test inputs for the compiler when it is in a state where it cannot even successfully compile |
I am putting my voice to this; it is extremely useful for bare metal programming, and I can't think of a reason that it's behind a feature gate. |
It's not as clear, post-RT removal, what |
The Reenix paper: http://scialex.github.io/reenix.pdf has some good insights, specifically on using the standard library in an osdev context |
It's extremely clear what Rust not having much of a runtime is great, but it's hardly sufficient--C has even less of a runtime than Rust, but that doesn't mean the Linux kernel can use functionality that relies on libc. It also doesn't mean that every embedded platform that LLVM supports is going to support, to pick an example at random, path munging. Rust's standard library currently makes a lot of assumptions about the system beyond "some sort of allocator exists" (and even then, the largest difficulties Reenix had were dealing with poor behavior from the stdilb allocator). It's also important to be able to define, or opt out of, the behavior of the runtime that Rust does still have (e.g. panics). |
Just to be clear: Someone casually reading this thread might think that this issue is some sort of front line to a battle where people are fighting to ensure that But as far as I can tell, no one is suggesting that we remove Looking at the description for the issue and the linked original thread ( rust-lang/rust#20537 ), the point of this ticket as I understand it is that there used to be many use cases for (Of course, comments listing such use cases will hopefully be useful to such documentation effort; but just saying "I want this feature!" is not going to help the documentation effort.) |
Yes, @pnkfelix , you are absolutely correct. The nature of |
@steveklabnik My goal in using My goal in using |
This was stabilized in 1.6. |
Previous thread: rust-lang/rust#20537
Now that the runtime is all but gone,
no_std
's purpose is a bit unclear. It's behind a feature gate, so figuring out exactly what it is and should do is part of the process to get it to be stable.The text was updated successfully, but these errors were encountered: