Skip to content

付録の和訳を最新版に更新 #269

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

Open
wants to merge 56 commits into
base: master-ja
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
e685c96
ch02 数当てゲームのプログラミングの和訳を最新版に更新
shinmili May 26, 2024
db3a649
リンク漏れ修正
shinmili Nov 28, 2024
24f5af0
コメントの位置修正
shinmili Dec 26, 2024
cf8947f
ch03 一般的なプログラミングの概念の和訳を最新版に更新
shinmili May 26, 2024
42a63a5
リンク漏れ修正
shinmili Nov 28, 2024
e0d2a48
誤字修正
shinmili Jan 31, 2025
42cf09e
ch04 所有権を理解するの和訳を最新版に更新
shinmili May 26, 2024
138f7fc
コメント閉じ忘れ修正
shinmili Nov 28, 2024
f5f69e9
コードブロックの訳し漏れ修正
shinmili Nov 28, 2024
40d8fd5
ch05 構造体を使用して関係のあるデータを構造化するの和訳を最新版に更新
shinmili May 26, 2024
70c7a13
ch06 Enumとパターンマッチングの和訳を最新版に更新
shinmili May 26, 2024
2f70d34
ch07 肥大化していくプロジェクトをパッケージ、クレート、モジュールを利用して管理するの和訳を最新版に更新
shinmili May 26, 2024
0c0c9d5
消し忘れた段落を削除
shinmili Nov 29, 2024
9eb0aa4
読点の修正
shinmili Nov 29, 2024
1139c13
ch08 一般的なコレクションの和訳を最新版に更新
shinmili May 26, 2024
32a5e00
誤字修正
shinmili Nov 30, 2024
cbd1f9c
消し忘れた段落を削除
shinmili Nov 30, 2024
777e045
コメントの閉じ方の誤りを修正
shinmili Nov 30, 2024
6da5374
修正漏れを修正
shinmili Nov 30, 2024
75aeb75
doc.rust-lang.org 内でのみ機能する相対リンクを修正
shinmili Nov 30, 2024
93e7c99
ch09 エラー処理の和訳を最新版に更新
shinmili May 26, 2024
ee5f863
不要な記号の削除
shinmili Nov 30, 2024
1e6ccf0
消し忘れた段落を削除
shinmili Nov 30, 2024
4e664a9
コメントの位置修正
shinmili Dec 27, 2024
4e3d9ea
ch10 ジェネリック型、トレイト、ライフタイムの和訳を最新版に更新
shinmili May 26, 2024
439eeec
消し忘れた段落を削除
shinmili Nov 30, 2024
fb60cce
ch11 自動テストを書くの和訳を最新版に更新
shinmili May 26, 2024
91b9e1a
見出しレベル誤りを修正
shinmili Dec 1, 2024
059af4e
消し忘れた段落を削除
shinmili Dec 1, 2024
5464a6e
余計な空行を削除
shinmili Dec 27, 2024
06f787f
訳し漏れの翻訳を追加
shinmili Jan 31, 2025
fff91f0
誤字修正
shinmili Jan 31, 2025
57c5588
ch12 入出力プロジェクト: コマンドラインプログラムを構築するの和訳を最新版に更新
shinmili May 26, 2024
e042c99
ch13 関数型言語の機能: イテレータとクロージャの和訳を最新版に更新
shinmili May 26, 2024
4543380
見出しレベル誤りを修正
shinmili Dec 1, 2024
57b18f1
訳し忘れを修正
shinmili Dec 1, 2024
db47fd2
ch14 CargoとCrates.ioについてより詳しくの和訳を最新版に更新
shinmili May 26, 2024
e3bf9f9
ch15 スマートポインタの和訳を最新版に更新
shinmili May 26, 2024
e49e340
消し忘れた段落を削除
shinmili Dec 7, 2024
64432c2
ch16 恐れるな!並行性の和訳を最新版に更新
shinmili May 26, 2024
bd648eb
ch17 Rustのオブジェクト指向プログラミング機能の和訳を最新版に更新
shinmili May 26, 2024
7f4328c
ch18 パターンとマッチングの和訳を最新版に更新
shinmili May 26, 2024
46a06ad
ch19 高度な機能の和訳を最新版に更新
shinmili May 26, 2024
a8f53a5
markdown の誤りを修正
shinmili Dec 8, 2024
e657cc7
消し忘れた段落を削除
shinmili Dec 8, 2024
634ef1a
誤リンク修正
shinmili Jan 31, 2025
7351cd9
ch20 最後のプロジェクト: マルチスレッドのWebサーバを構築するの和訳を最新版に更新
shinmili May 26, 2024
d6477e2
付録A: キーワードの和訳をアップデート
shinmili May 26, 2024
07bc7e9
付録B: 演算子と記号の和訳をアップデート
shinmili May 26, 2024
8a44126
付録C: 導出可能なトレイトの和訳をアップデート
shinmili May 26, 2024
61796c9
付録D: 便利な開発ツールの和訳をアップデート
shinmili May 26, 2024
11c6f83
付録F: 本の翻訳の和訳をアップデート
shinmili May 26, 2024
6fb6df6
付録G: Rustの作られ方と“Nightly Rust”の和訳をアップデート
shinmili May 26, 2024
aceff44
訳し忘れを修正
shinmili Dec 8, 2024
ae12469
表内の行の削除・並び替えに合わせて修正
shinmili Dec 8, 2024
b5c6eaa
消し忘れた見出しを削除
shinmili Dec 8, 2024
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
Prev Previous commit
Next Next commit
ch19 高度な機能の和訳を最新版に更新
  • Loading branch information
shinmili committed Feb 4, 2025
commit 46a06ad6ed48a7fd4ec54decccac9024aebae433
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-01/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-02/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-03/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-04/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-05/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
29 changes: 15 additions & 14 deletions listings/ch19-advanced-features/listing-19-05/output.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
$ cargo run
Compiling unsafe-example v0.1.0 (file:///projects/unsafe-example)
error[E0499]: cannot borrow `*slice` as mutable more than once at a time
--> src/main.rs:6:30
error[E0499]: cannot borrow `*values` as mutable more than once at a time
(エラー: 一度に2回以上、`*values`を可変で借用できません)
--> src/main.rs:6:31
|
1 | fn split_at_mut(slice: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
| - let's call the lifetime of this reference `'1`
1 | fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
| - let's call the lifetime of this reference `'1`
| (この参照のライフタイムを`'1`とします)
...
6 | (&mut slice[..mid], &mut slice[mid..])
| -------------------------^^^^^--------
| | | |
| | | second mutable borrow occurs here
6 | (&mut values[..mid], &mut values[mid..])
| --------------------------^^^^^^--------
| | | |
| | | second mutable borrow occurs here
| | | (2回目の可変参照はここで発生します)
| | first mutable borrow occurs here
| returning this value requires that `*slice` is borrowed for `'1`

error: aborting due to previous error
| | (1回目の可変参照はここで発生します)
| returning this value requires that `*values` is borrowed for `'1`
| (この値を返すためには`*values`が`'1`の間借用されていることが必要です)

For more information about this error, try `rustc --explain E0499`.
error: could not compile `unsafe-example`.

To learn more, run the command again with --verbose.
error: could not compile `unsafe-example` (bin "unsafe-example") due to 1 previous error
6 changes: 3 additions & 3 deletions listings/ch19-advanced-features/listing-19-05/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// ANCHOR: here
fn split_at_mut(slice: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
let len = slice.len();
fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
let len = values.len();

assert!(mid <= len);

(&mut slice[..mid], &mut slice[mid..])
(&mut values[..mid], &mut values[mid..])
}
// ANCHOR_END: here

Expand Down
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-06/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
6 changes: 3 additions & 3 deletions listings/ch19-advanced-features/listing-19-06/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// ANCHOR: here
use std::slice;

fn split_at_mut(slice: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
let len = slice.len();
let ptr = slice.as_mut_ptr();
fn split_at_mut(values: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {
let len = values.len();
let ptr = values.as_mut_ptr();

assert!(mid <= len);

Expand Down
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-07/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
2 changes: 1 addition & 1 deletion listings/ch19-advanced-features/listing-19-07/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ fn main() {
let address = 0x01234usize;
let r = address as *mut i32;

let slice: &[i32] = unsafe { slice::from_raw_parts_mut(r, 10000) };
let values: &[i32] = unsafe { slice::from_raw_parts_mut(r, 10000) };
// ANCHOR_END: here
}
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-08/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
1 change: 1 addition & 0 deletions listings/ch19-advanced-features/listing-19-08/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern "C" {

fn main() {
unsafe {
// -3の絶対値は、Cによると{}
println!("Absolute value of -3 according to C: {}", abs(-3));
}
}
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-09/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-10/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-11/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "unsafe-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
2 changes: 2 additions & 0 deletions listings/ch19-advanced-features/listing-19-11/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
unsafe trait Foo {
// methods go here
// メソッドがここに来る
}

unsafe impl Foo for i32 {
// method implementations go here
// メソッドの実装がここに来る
}

fn main() {}
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-12/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-13/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-14/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
2 changes: 1 addition & 1 deletion listings/ch19-advanced-features/listing-19-14/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::ops::Add;

#[derive(Debug, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq)]
struct Point {
x: i32,
y: i32,
Expand Down
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-15/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-16/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 3 additions & 0 deletions listings/ch19-advanced-features/listing-19-16/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ struct Human;

impl Pilot for Human {
fn fly(&self) {
// こちら機長です。
println!("This is your captain speaking.");
}
}

impl Wizard for Human {
fn fly(&self) {
// 上がれ!
println!("Up!");
}
}

impl Human {
fn fly(&self) {
// *激しく腕を振る*
println!("*waving arms furiously*");
}
}
Expand Down
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-17/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-18/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-19/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 3 additions & 0 deletions listings/ch19-advanced-features/listing-19-19/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,19 @@ struct Dog;

impl Dog {
fn baby_name() -> String {
// スポット
String::from("Spot")
}
}

impl Animal for Dog {
fn baby_name() -> String {
// 子犬
String::from("puppy")
}
}

fn main() {
// 赤ちゃん犬は{}と呼ばれる
println!("A baby dog is called a {}", Dog::baby_name());
}
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-20/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
23 changes: 13 additions & 10 deletions listings/ch19-advanced-features/listing-19-20/output.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
$ cargo run
Compiling traits-example v0.1.0 (file:///projects/traits-example)
error[E0283]: type annotations needed
error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
(エラー: 対応する`impl`型を指定せずにトレイト上の関連関数を呼び出すことはできません)
--> src/main.rs:20:43
|
2 | fn baby_name() -> String;
| ------------------------- required by `Animal::baby_name`
| ------------------------- `Animal::baby_name` defined here
| (`Animal::baby_name`はここで定義されています)
...
20 | println!("A baby dog is called a {}", Animal::baby_name());
| ^^^^^^^^^^^^^^^^^ cannot infer type
| ^^^^^^^^^^^^^^^^^ cannot call associated function of trait
| (トレイトの関連関数を呼び出すことができません)
|
= note: cannot resolve `_: Animal`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0283`.
error: could not compile `traits-example`.
help: use the fully-qualified path to the only available implementation
(ヘルプ: 利用可能な実装のうち1つを指すフルパスを使用してください)
|
20 | println!("A baby dog is called a {}", <Dog as Animal>::baby_name());
| +++++++ +

To learn more, run the command again with --verbose.
For more information about this error, try `rustc --explain E0790`.
error: could not compile `traits-example` (bin "traits-example") due to 1 previous error
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-21/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-22/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-23/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "traits-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-24/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "types-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
3 changes: 1 addition & 2 deletions listings/ch19-advanced-features/listing-19-25/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[package]
name = "types-example"
version = "0.1.0"
authors = ["Your Name <you@example.com>"]
edition = "2018"
edition = "2021"

[dependencies]
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy