From 093a312352f57494d5c504bb87368048a7b59531 Mon Sep 17 00:00:00 2001 From: "Tatsuya Kawano (Circle CI)" Date: Sat, 25 Jun 2016 13:36:02 +0800 Subject: [PATCH 1/2] Update Using Rust without the Standard Library to 1.9 --- ...using-rust-without-the-standard-library.md | 17 +++++++-------- ...using-rust-without-the-standard-library.md | 21 ------------------- 2 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 diff-1.6.0..1.9.0/src/doc/book/using-rust-without-the-standard-library.md diff --git a/1.9/ja/book/using-rust-without-the-standard-library.md b/1.9/ja/book/using-rust-without-the-standard-library.md index 92fcccca..721f079e 100644 --- a/1.9/ja/book/using-rust-without-the-standard-library.md +++ b/1.9/ja/book/using-rust-without-the-standard-library.md @@ -6,9 +6,9 @@ -Rustの標準ライブラリは多くの便利な機能を提供している一方で、 -スレッド、ネットワーク、ヒープアロケーション、その他の多くの機能をホストシステムが提供していることを前提としています。 -一方で、それらの機能を提供していないシステムも存在します。しかし、Rustはそれらの上でも利用することができます! +Rustの標準ライブラリは多くの便利な機能を提供している一方で、スレッド、ネットワーク、ヒープアロケーション、その他の多くの機能をホストシステムが提供していることを前提としています。 +一方で、それらの機能を提供していないシステムも存在します。 +しかし、Rustはそれらの上でも利用することができます! それは、Rustに標準ライブラリを利用しないということを `#![no_std]` アトリビュートを利用して伝えることで可能となります。 @@ -20,7 +20,7 @@ Rustの標準ライブラリは多くの便利な機能を提供している一 > 例えば、 `#![no_std]` を含んだ _ライブラリ_ は 安定版でビルド可能ですが、 _バイナリ_ はビルド不可能です。 > 標準ライブラリを利用しないバイナリについては [`#![no_std]` についての不安定版のドキュメント](no-stdlib.html) を確認してください。 - + `#![no_std]` アトリビュートを利用するには、クレートのトップに以下のように追加します: ```rust @@ -35,16 +35,13 @@ fn plus_one(x: i32) -> i32 { - + 標準ライブラリで提供されている多くの機能は [`core` クレート](../core/) を用いることでも利用できます。 -標準ライブラリを利用しているとき、Rustは自動的に `std` をスコープに導入し、 -標準ライブラリの機能を明示的にインポートすること無しに利用可能にします。 -それと同じように、もし `#![no_std]` を利用しているときは、 -Rustは自動的に `core` と [そのプレリュード](../core/prelude/v1/) をスコープに導入します。 +標準ライブラリを利用しているとき、Rustは自動的に `std` をスコープに導入し、標準ライブラリの機能を明示的にインポートすること無しに利用可能にします。 +それと同じように、もし `#![no_std]` を利用しているときは、Rustは自動的に `core` と [そのプレリュード](../core/prelude/v1/) をスコープに導入します。 これは、例えば多くの以下のようなコードが動作することを意味しています: - ```rust #![no_std] diff --git a/diff-1.6.0..1.9.0/src/doc/book/using-rust-without-the-standard-library.md b/diff-1.6.0..1.9.0/src/doc/book/using-rust-without-the-standard-library.md deleted file mode 100644 index 4d750b59..00000000 --- a/diff-1.6.0..1.9.0/src/doc/book/using-rust-without-the-standard-library.md +++ /dev/null @@ -1,21 +0,0 @@ ---- a/src/doc/book/using-rust-without-the-standard-library.md -+++ b/src/doc/book/using-rust-without-the-standard-library.md -@@ -11,7 +11,7 @@ don’t want to use the standard library via an attribute: `#![no_std]`. - > For details on binaries without the standard library, see [the nightly - > chapter on `#![no_std]`](no-stdlib.html) - --To use `#![no_std]`, add a it to your crate root: -+To use `#![no_std]`, add it to your crate root: - - ```rust - #![no_std] -@@ -25,7 +25,7 @@ Much of the functionality that’s exposed in the standard library is also - available via the [`core` crate](../core/). When we’re using the standard - library, Rust automatically brings `std` into scope, allowing you to use - its features without an explicit import. By the same token, when using --`!#[no_std]`, Rust will bring `core` into scope for you, as well as [its -+`#![no_std]`, Rust will bring `core` into scope for you, as well as [its - prelude](../core/prelude/v1/). This means that a lot of code will Just Work: - - ```rust -diff --git a/src/doc/book/variable-bindings.md b/src/doc/book/variable-bindings.md From f470c608f6b07ed6cb32b945fed6b05b61b228f4 Mon Sep 17 00:00:00 2001 From: "Tatsuya Kawano (Circle CI)" Date: Thu, 2 Mar 2017 21:02:28 +0800 Subject: [PATCH 2/2] Cosmetics on the translation of Using Rust without the Standard Library (1.9) --- 1.9/ja/book/using-rust-without-the-standard-library.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/1.9/ja/book/using-rust-without-the-standard-library.md b/1.9/ja/book/using-rust-without-the-standard-library.md index 721f079e..eba6fe9f 100644 --- a/1.9/ja/book/using-rust-without-the-standard-library.md +++ b/1.9/ja/book/using-rust-without-the-standard-library.md @@ -8,15 +8,14 @@ Rustの標準ライブラリは多くの便利な機能を提供している一方で、スレッド、ネットワーク、ヒープアロケーション、その他の多くの機能をホストシステムが提供していることを前提としています。 一方で、それらの機能を提供していないシステムも存在します。 -しかし、Rustはそれらの上でも利用することができます! +しかし、Rustはそれらの上でも利用できます! それは、Rustに標準ライブラリを利用しないということを `#![no_std]` アトリビュートを利用して伝えることで可能となります。 - -> メモ: このフィーチャーは技術的には安定していますが、いくつか注意点が有ります。 +> メモ: このフィーチャーは技術的には安定していますが、いくつか注意点があります。 > 例えば、 `#![no_std]` を含んだ _ライブラリ_ は 安定版でビルド可能ですが、 _バイナリ_ はビルド不可能です。 > 標準ライブラリを利用しないバイナリについては [`#![no_std]` についての不安定版のドキュメント](no-stdlib.html) を確認してください。