Skip to content

[WIP] 1.7.0へのアップグレード準備 #127

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

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,22 @@
TBD。それっぽくどうにかして下さい

# バージョンアップに対応する
Rustがバージョンアップされるとこちらのレポジトリに

TBD。方針としては
1. 1つ前のバージョンと最新版とのdiff(1ファイル毎)
2. 1つ前のバージョンの翻訳のコピー

* 英文のパッチと一緒に訳文をPRすることで訳し漏れをなくす
* 未完な(バージョンと内容の一致していない)文書は公開したくない
がコミットされます。1.のdiffを1ファイル消化する形で2.をアップデートしていきます。作業する時は

* diffファイル群の中から1つ翻訳するdiffを選ぶ
* 翻訳のアップデート **開始時** にプルリクエストを上げる
* 細かい部分は [新たに翻訳する](#新たに翻訳する) を参照して下さい。
* 作業は
1. 日本語訳のアップデート
2. 日本語訳中にコメントアウトされている原文のアップデート
3. 訳したdiffの削除

詳しくはこちら議論をご覧下さい https://github.com/rust-lang-ja/the-rust-programming-language-ja/issues/107

# プルリクの指針

Expand Down
Empty file added diff-1.6.0..1.7.0/diff
Empty file.
39 changes: 39 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--- a/src/doc/book/README.md
+++ b/src/doc/book/README.md
@@ -14,31 +14,25 @@ Even then, Rust still allows precise control like a low-level language would.

[rust]: https://www.rust-lang.org

-“The Rust Programming Language” is split into eight sections. This introduction
+“The Rust Programming Language” is split into chapters. This introduction
is the first. After this:

* [Getting started][gs] - Set up your computer for Rust development.
-* [Learn Rust][lr] - Learn Rust programming through small projects.
-* [Effective Rust][er] - Higher-level concepts for writing excellent Rust code.
+* [Tutorial: Guessing Game][gg] - Learn some Rust with a small project.
* [Syntax and Semantics][ss] - Each bit of Rust, broken down into small chunks.
+* [Effective Rust][er] - Higher-level concepts for writing excellent Rust code.
* [Nightly Rust][nr] - Cutting-edge features that aren’t in stable builds yet.
* [Glossary][gl] - A reference of terms used in the book.
* [Bibliography][bi] - Background on Rust's influences, papers about Rust.

[gs]: getting-started.html
-[lr]: learn-rust.html
+[gg]: guessing-game.html
[er]: effective-rust.html
[ss]: syntax-and-semantics.html
[nr]: nightly-rust.html
[gl]: glossary.html
[bi]: bibliography.html

-After reading this introduction, you’ll want to dive into either ‘Learn Rust’ or
-‘Syntax and Semantics’, depending on your preference: ‘Learn Rust’ if you want
-to dive in with a project, or ‘Syntax and Semantics’ if you prefer to start
-small, and learn a single concept thoroughly before moving onto the next.
-Copious cross-linking connects these parts together.
-
### Contributing

The source files from which this book is generated can be found on
diff --git a/src/doc/book/SUMMARY.md b/src/doc/book/SUMMARY.md
15 changes: 15 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
--- a/src/doc/book/SUMMARY.md
+++ b/src/doc/book/SUMMARY.md
@@ -1,10 +1,7 @@
# Summary

* [Getting Started](getting-started.md)
-* [Learn Rust](learn-rust.md)
- * [Guessing Game](guessing-game.md)
- * [Dining Philosophers](dining-philosophers.md)
- * [Rust Inside Other Languages](rust-inside-other-languages.md)
+* [Tutorial: Guessing Game](guessing-game.md)
* [Syntax and Semantics](syntax-and-semantics.md)
* [Variable Bindings](variable-bindings.md)
* [Functions](functions.md)
diff --git a/src/doc/book/associated-types.md b/src/doc/book/associated-types.md
25 changes: 25 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/associated-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/src/doc/book/associated-types.md
+++ b/src/doc/book/associated-types.md
@@ -24,7 +24,7 @@ fn distance<N, E, G: Graph<N, E>>(graph: &G, start: &N, end: &N) -> u32 { ... }
```

Our distance calculation works regardless of our `Edge` type, so the `E` stuff in
-this signature is just a distraction.
+this signature is a distraction.

What we really want to say is that a certain `E`dge and `N`ode type come together
to form each kind of `Graph`. We can do that with associated types:
@@ -118,10 +118,10 @@ impl Graph for MyGraph {
This silly implementation always returns `true` and an empty `Vec<Edge>`, but it
gives you an idea of how to implement this kind of thing. We first need three
`struct`s, one for the graph, one for the node, and one for the edge. If it made
-more sense to use a different type, that would work as well, we’re just going to
+more sense to use a different type, that would work as well, we’re going to
use `struct`s for all three here.

-Next is the `impl` line, which is just like implementing any other trait.
+Next is the `impl` line, which is an implementation like any other trait.

From here, we use `=` to define our associated types. The name the trait uses
goes on the left of the `=`, and the concrete type we’re `impl`ementing this
diff --git a/src/doc/book/bibliography.md b/src/doc/book/bibliography.md
12 changes: 12 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/bibliography.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- a/src/doc/book/bibliography.md
+++ b/src/doc/book/bibliography.md
@@ -33,7 +33,7 @@ Rust, as well as publications about Rust.
* [Non-blocking steal-half work queues](http://www.cs.bgu.ac.il/%7Ehendlerd/papers/p280-hendler.pdf)
* [Reagents: expressing and composing fine-grained concurrency](http://www.mpi-sws.org/~turon/reagents.pdf)
* [Algorithms for scalable synchronization of shared-memory multiprocessors](https://www.cs.rochester.edu/u/scott/papers/1991_TOCS_synch.pdf)
-* [Epoc-based reclamation](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-579.pdf).
+* [Epoch-based reclamation](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-579.pdf).

### Others

diff --git a/src/doc/book/casting-between-types.md b/src/doc/book/casting-between-types.md
12 changes: 12 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/casting-between-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- a/src/doc/book/casting-between-types.md
+++ b/src/doc/book/casting-between-types.md
@@ -154,7 +154,7 @@ implemented. For this, we need something more dangerous.
The `transmute` function is provided by a [compiler intrinsic][intrinsics], and
what it does is very simple, but very scary. It tells Rust to treat a value of
one type as though it were another type. It does this regardless of the
-typechecking system, and just completely trusts you.
+typechecking system, and completely trusts you.

[intrinsics]: intrinsics.html

diff --git a/src/doc/book/choosing-your-guarantees.md b/src/doc/book/choosing-your-guarantees.md
35 changes: 35 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/choosing-your-guarantees.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
--- a/src/doc/book/choosing-your-guarantees.md
+++ b/src/doc/book/choosing-your-guarantees.md
@@ -52,7 +52,7 @@ These pointers cannot be copied in such a way that they outlive the lifetime ass

## `*const T` and `*mut T`

-These are C-like raw pointers with no lifetime or ownership attached to them. They just point to
+These are C-like raw pointers with no lifetime or ownership attached to them. They point to
some location in memory with no other restrictions. The only guarantee that these provide is that
they cannot be dereferenced except in code marked `unsafe`.

@@ -255,7 +255,7 @@ major ones will be covered below.

## `Arc<T>`

-[`Arc<T>`][arc] is just a version of `Rc<T>` that uses an atomic reference count (hence, "Arc").
+[`Arc<T>`][arc] is a version of `Rc<T>` that uses an atomic reference count (hence, "Arc").
This can be sent freely between threads.

C++'s `shared_ptr` is similar to `Arc`, however in the case of C++ the inner data is always mutable.
@@ -340,11 +340,11 @@ With the former, the `RefCell<T>` is wrapping the `Vec<T>`, so the `Vec<T>` in i
mutable. At the same time, there can only be one mutable borrow of the whole `Vec` at a given time.
This means that your code cannot simultaneously work on different elements of the vector from
different `Rc` handles. However, we are able to push and pop from the `Vec<T>` at will. This is
-similar to an `&mut Vec<T>` with the borrow checking done at runtime.
+similar to a `&mut Vec<T>` with the borrow checking done at runtime.

With the latter, the borrowing is of individual elements, but the overall vector is immutable. Thus,
we can independently borrow separate elements, but we cannot push or pop from the vector. This is
-similar to an `&mut [T]`[^3], but, again, the borrow checking is at runtime.
+similar to a `&mut [T]`[^3], but, again, the borrow checking is at runtime.

In concurrent programs, we have a similar situation with `Arc<Mutex<T>>`, which provides shared
mutability and ownership.
diff --git a/src/doc/book/closures.md b/src/doc/book/closures.md
39 changes: 39 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/closures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
--- a/src/doc/book/closures.md
+++ b/src/doc/book/closures.md
@@ -208,7 +208,7 @@ different.

Rust’s implementation of closures is a bit different than other languages. They
are effectively syntax sugar for traits. You’ll want to make sure to have read
-the [traits chapter][traits] before this one, as well as the chapter on [trait
+the [traits][traits] section before this one, as well as the section on [trait
objects][trait-objects].

[traits]: traits.html
@@ -253,7 +253,7 @@ use it.
# Taking closures as arguments

Now that we know that closures are traits, we already know how to accept and
-return closures: just like any other trait!
+return closures: the same as any other trait!

This also means that we can choose static vs dynamic dispatch as well. First,
let’s write a function which takes something callable, calls it, and returns
@@ -271,7 +271,7 @@ let answer = call_with_one(|x| x + 2);
assert_eq!(3, answer);
```

-We pass our closure, `|x| x + 2`, to `call_with_one`. It just does what it
+We pass our closure, `|x| x + 2`, to `call_with_one`. It does what it
suggests: it calls the closure, giving it `1` as an argument.

Let’s examine the signature of `call_with_one` in more depth:
@@ -448,7 +448,7 @@ This error is letting us know that we don’t have a `&'static Fn(i32) -> i32`,
we have a `[closure@<anon>:7:9: 7:20]`. Wait, what?

Because each closure generates its own environment `struct` and implementation
-of `Fn` and friends, these types are anonymous. They exist just solely for
+of `Fn` and friends, these types are anonymous. They exist solely for
this closure. So Rust shows them as `closure@<anon>`, rather than some
autogenerated name.

diff --git a/src/doc/book/concurrency.md b/src/doc/book/concurrency.md
16 changes: 16 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/concurrency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- a/src/doc/book/concurrency.md
+++ b/src/doc/book/concurrency.md
@@ -305,10 +305,10 @@ fn main() {
}
```

-We use the `mpsc::channel()` method to construct a new channel. We just `send`
+We use the `mpsc::channel()` method to construct a new channel. We `send`
a simple `()` down the channel, and then wait for ten of them to come back.

-While this channel is just sending a generic signal, we can send any data that
+While this channel is sending a generic signal, we can send any data that
is `Send` over the channel!

```rust
diff --git a/src/doc/book/crates-and-modules.md b/src/doc/book/crates-and-modules.md
46 changes: 46 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/crates-and-modules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
--- a/src/doc/book/crates-and-modules.md
+++ b/src/doc/book/crates-and-modules.md
@@ -2,7 +2,7 @@

When a project starts getting large, it’s considered good software
engineering practice to split it up into a bunch of smaller pieces, and then
-fit them together. It’s also important to have a well-defined interface, so
+fit them together. It is also important to have a well-defined interface, so
that some of your functionality is private, and some is public. To facilitate
these kinds of things, Rust has a module system.

@@ -222,7 +222,7 @@ fn hello() -> String {
}
```

-Of course, you can copy and paste this from this web page, or just type
+Of course, you can copy and paste this from this web page, or type
something else. It’s not important that you actually put ‘konnichiwa’ to learn
about the module system.

@@ -299,7 +299,7 @@ depth.
Rust allows you to precisely control which aspects of your interface are
public, and so private is the default. To make things public, you use the `pub`
keyword. Let’s focus on the `english` module first, so let’s reduce our `src/main.rs`
-to just this:
+to only this:

```rust,ignore
extern crate phrases;
@@ -447,7 +447,7 @@ use phrases::english::{greetings, farewells};

## Re-exporting with `pub use`

-You don’t just use `use` to shorten identifiers. You can also use it inside of your crate
+You don’t only use `use` to shorten identifiers. You can also use it inside of your crate
to re-export a function inside another module. This allows you to present an external
interface that may not directly map to your internal code organization.

@@ -584,5 +584,5 @@ use sayings::english::farewells as en_farewells;
```

As you can see, the curly brackets compress `use` statements for several items
-under the same path, and in this context `self` just refers back to that path.
+under the same path, and in this context `self` refers back to that path.
Note: The curly brackets cannot be nested or mixed with star globbing.
diff --git a/src/doc/book/custom-allocators.md b/src/doc/book/custom-allocators.md
21 changes: 21 additions & 0 deletions diff-1.6.0..1.7.0/src/doc/book/custom-allocators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--- a/src/doc/book/custom-allocators.md
+++ b/src/doc/book/custom-allocators.md
@@ -13,7 +13,7 @@ own allocator up and running.

The compiler currently ships two default allocators: `alloc_system` and
`alloc_jemalloc` (some targets don't have jemalloc, however). These allocators
-are just normal Rust crates and contain an implementation of the routines to
+are normal Rust crates and contain an implementation of the routines to
allocate and deallocate memory. The standard library is not compiled assuming
either one, and the compiler will decide which allocator is in use at
compile-time depending on the type of output artifact being produced.
@@ -134,7 +134,7 @@ pub extern fn __rust_usable_size(size: usize, _align: usize) -> usize {
size
}

-# // just needed to get rustdoc to test this
+# // only needed to get rustdoc to test this
# fn main() {}
# #[lang = "panic_fmt"] fn panic_fmt() {}
# #[lang = "eh_personality"] fn eh_personality() {}
diff --git a/src/doc/book/dining-philosophers.md b/src/doc/book/dining-philosophers.md
Loading