Skip to content

Commit 1a9cc22

Browse files
authored
Merge pull request #71 from TonalidadeHidrica/small-fixes
細かい修正
2 parents c30fedb + 98e27de commit 1a9cc22

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

src/rust-2018/trait-fn-parameters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ In accordance with RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685),
4040
parameters in trait method declarations are no longer allowed to be anonymous.
4141
-->
4242

43-
RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685)に基づいて、トレイト関数のパラメータを匿名にすることはできなくなりました。
43+
RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685) に基づいて、トレイト関数のパラメータを匿名にすることはできなくなりました。
4444

4545
<!--
4646
For example, in the 2015 edition, this was allowed:
@@ -59,7 +59,7 @@ In the 2018 edition, all parameters must be given an argument name (even if it'
5959
`_`):
6060
-->
6161

62-
2018 エディションでは、すべての引数名に(ただの `_` であってもいいので、何らかの)名前がついていなければなりません:
62+
2018 エディションでは、すべての引数に(ただの `_` であってもいいので、何らかの)名前がついていなければなりません:
6363

6464
```rust
6565
trait Foo {

src/rust-2018/tyvar-behind-raw-pointer.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ See Rust issue [#46906] for details.
3636
詳細は Rust のイシュー [#46906] を参照してください。
3737

3838
> *訳注*:
39-
> 詳しく解説します。以下のプログラムをご覧ください。
39+
> 詳しく解説します。以下のプログラムをご覧ください[^citation-46906]
4040
>
4141
> ```rust,ignore
4242
> let s = libc::getenv(k.as_ptr()) as *const _;
@@ -55,7 +55,7 @@ See Rust issue [#46906] for details.
5555
> この新機能は "arbitrary self types" (self の型の任意化)と呼ばれます。
5656
> しかし、これが導入されると困ったことが起きます。
5757
>
58-
> 次のような構造体があったとしましょう:
58+
> 次のような構造体があったとしましょう[^citation-46906]:
5959
> ```rust,ignore
6060
> #![feature(arbitrary_self_types)]
6161
>
@@ -77,7 +77,7 @@ See Rust issue [#46906] for details.
7777
> もう一つは今 `*const MyType` に対して実装された `is_null` です。
7878
> つまり、メソッドの呼び出しに曖昧性が生じています。
7979
>
80-
> この問題の解決策は簡単です。キャスト後の型がどの定数ポインタになるのか明示すればよいです:
80+
> この問題の解決策は簡単です。キャスト後の型がどの定数ポインタになるのか明示すればよいです[^citation-46906]:
8181
>
8282
> ```rust,ignore
8383
> let s = libc::getenv(k.as_ptr()) as *const libc::c_char;
@@ -91,6 +91,8 @@ See Rust issue [#46906] for details.
9191
> こうした理由から、 `*const _` や `*mut _` など、「未知の型への生ポインタ」に対してメソッドを呼び出すと、コンパイラがそれを検知するようになりました。
9292
> 最初は警告リントとして導入されましたが、Rust 2018 エディションでハードエラーに格上げされました。これが、本ページで説明されている変更点です。
9393
94+
[^citation-46906]: これらのソースコードは [mikeyhew](https://github.com/mikeyhew) 氏による [rust-lang/rust#46906 へのコメント](https://github.com/rust-lang/rust/issues/46906#issue-283871408)より引用されたものです。ただし、コメントが著者によって追加されています。
95+
9496
[^2]: 関連関数のうち、第一引数が `self` であるものは、メソッド呼び出し演算子(`.`)を用いて呼び出すことができます。
9597
このような関連関数をメソッドと呼びます。
9698
`s.is_null()` と書くと、これは `s` に対してメソッド `is_null(...)` を呼び出していることになります。

src/rust-2021/IntoIterator-for-arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ by calling `iter()` which also iterates over owned arrays by reference:
180180
fn main() {
181181
let array = [1u8, 2, 3];
182182
for x in array.iter() { // <- This line changed
183-
// <- この行を書き換えた
183+
// この行を書き換えた
184184
// x is a `&u8` in all editions
185185
// x はすべてのエディションで `&u8`
186186
}

src/rust-2021/default-cargo-resolver.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Now, the `diesel_migrations` proc-macro will get the "postgres" feature enabled,
246246

247247
これにより、 Cargo はホスト依存関係(proc-macro と build-dependencies)のフィーチャとして "postgres" を追加します。
248248

249-
> 訳注:ホスト依存関係とは、コンパイラホスト(コンパイラを実行しているプラットフォーム)向けにビルド・実行される依存を指し、proc-macroクレートやbuild-dependencies配下の依存クレートが該当します
249+
> 訳注:ホスト依存関係とは、コンパイラホスト(コンパイラを実行しているプラットフォーム)向けにビルド・実行される依存を指し、proc-macro クレートや build-dependencies 配下の依存クレートが該当します
250250
> 一方、通常の依存関係はコンパイルターゲットのプラットフォーム向けにビルドされます。
251251
252252
これで、 `diesel_migrations` の手続き的マクロは "postgres" フィーチャが有効化された状態で走り、正しくビルドされます。

src/rust-2021/prelude.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ Some users invoke methods on a `dyn Trait` value where the method name overlaps
187187
mod submodule {
188188
pub trait MyTrait {
189189
// This has the same name as `TryInto::try_into`
190+
// これは `TryInto::try_into` と同名
190191
fn try_into(&self) -> Result<u32, ()>;
191192
}
192193
}

0 commit comments

Comments
 (0)