66<!-- allocation, and others. There are systems that do not have these features, -->
77<!-- however, and Rust can work with those too! To do so, we tell Rust that we -->
88<!-- don’t want to use the standard library via an attribute: `#![no_std]`. -->
9- Rustの標準ライブラリは多くの便利な機能を提供している一方で、
10- スレッド、ネットワーク、ヒープアロケーション、その他の多くの機能をホストシステムが提供していることを前提としています 。
11- 一方で、それらの機能を提供していないシステムも存在します。 しかし、Rustはそれらの上でも利用することができます!
9+ Rustの標準ライブラリは多くの便利な機能を提供している一方で、スレッド、ネットワーク、ヒープアロケーション、その他の多くの機能をホストシステムが提供していることを前提としています。
10+ 一方で、それらの機能を提供していないシステムも存在します 。
11+ しかし、Rustはそれらの上でも利用できます!
1212それは、Rustに標準ライブラリを利用しないということを ` #![no_std] ` アトリビュートを利用して伝えることで可能となります。
1313
14-
1514<!-- > Note: This feature is technically stable, but there are some caveats. For -->
1615<!-- > one, you can build a `#![no_std]` _library_ on stable, but not a _binary_. -->
1716<!-- > For details on binaries without the standard library, see [the nightly -->
1817<!-- > chapter on `#![no_std]`](no-stdlib.html) -->
19- > メモ: このフィーチャーは技術的には安定していますが、いくつか注意点が有ります 。
18+ > メモ: このフィーチャーは技術的には安定していますが、いくつか注意点があります 。
2019> 例えば、 ` #![no_std] ` を含んだ _ ライブラリ_ は 安定版でビルド可能ですが、 _ バイナリ_ はビルド不可能です。
2120> 標準ライブラリを利用しないバイナリについては [ ` #![no_std] ` についての不安定版のドキュメント] ( no-stdlib.html ) を確認してください。
2221
23- <!-- To use `#![no_std]`, add a it to your crate root: -->
22+ <!-- To use `#![no_std]`, add it to your crate root: -->
2423` #![no_std] ` アトリビュートを利用するには、クレートのトップに以下のように追加します:
2524
2625``` rust
@@ -35,16 +34,13 @@ fn plus_one(x: i32) -> i32 {
3534<!-- available via the [`core` crate](../core/). When we’re using the standard -->
3635<!-- library, Rust automatically brings `std` into scope, allowing you to use -->
3736<!-- its features without an explicit import. By the same token, when using -->
38- <!-- `!# [no_std]`, Rust will bring `core` into scope for you, as well as [its -->
37+ <!-- `#! [no_std]`, Rust will bring `core` into scope for you, as well as [its -->
3938<!-- prelude](../core/prelude/v1/). This means that a lot of code will Just Work: -->
4039標準ライブラリで提供されている多くの機能は [ ` core ` クレート] ( ../core/ ) を用いることでも利用できます。
41- 標準ライブラリを利用しているとき、Rustは自動的に ` std ` をスコープに導入し、
42- 標準ライブラリの機能を明示的にインポートすること無しに利用可能にします。
43- それと同じように、もし ` #![no_std] ` を利用しているときは、
44- Rustは自動的に ` core ` と [ そのプレリュード] ( ../core/prelude/v1/ ) をスコープに導入します。
40+ 標準ライブラリを利用しているとき、Rustは自動的に ` std ` をスコープに導入し、標準ライブラリの機能を明示的にインポートすること無しに利用可能にします。
41+ それと同じように、もし ` #![no_std] ` を利用しているときは、Rustは自動的に ` core ` と [ そのプレリュード] ( ../core/prelude/v1/ ) をスコープに導入します。
4542これは、例えば多くの以下のようなコードが動作することを意味しています:
4643
47-
4844``` rust
4945#![no_std]
5046
0 commit comments