Skip to content

Commit ecd060b

Browse files
authored
Merge pull request #64 from TonalidadeHidrica/trait-fn-parameters
「トレイト関数の匿名パラメータの非推奨化」を翻訳
2 parents d2b3689 + 8592659 commit ecd060b

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

TranslationTable.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
| binary | バイナリ
3131
| binding | 束縛
3232
| block | ブロック
33+
| body (関数の) | 本体
3334
| borrowing | 借用
3435
| bounds | 境界
3536
| boxed | ボックス化された

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
- [Rust 2018](rust-2018/index.md)
3535
- [Path and module system changes](rust-2018/path-changes.md)
36-
- [Anonymous trait function parameters deprecated](rust-2018/trait-fn-parameters.md)
36+
- [トレイト関数の匿名パラメータの非推奨化](rust-2018/trait-fn-parameters.md)
3737
- [New keywords](rust-2018/new-keywords.md)
3838
- [Method dispatch for raw pointers to inference variables](rust-2018/tyvar-behind-raw-pointer.md)
3939
- [Cargo changes](rust-2018/cargo.md)

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,65 @@
1+
<!--
12
# Anonymous trait function parameters deprecated
3+
-->
24

5+
# トレイト関数の匿名パラメータの非推奨化
6+
7+
<!--
38
![Minimum Rust version: 1.31](https://img.shields.io/badge/Minimum%20Rust%20Version-1.31-brightgreen.svg)
9+
-->
10+
11+
![導入 Rust バージョン: 1.31](https://img.shields.io/badge/%E5%B0%8E%E5%85%A5%20Rust%20%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3-1.31-brightgreen.svg)
412

13+
<!--
514
## Summary
15+
-->
16+
17+
## 概要
618

19+
<!--
720
- [Trait function parameters] may use any irrefutable pattern when the function has a body.
21+
-->
822

23+
- 関数に本体があるとき、[トレイト関数のパラメータ]は、任意の論駁不可能なパターンを使えます。
24+
25+
<!--
926
[Trait function parameters]: https://doc.rust-lang.org/stable/reference/items/traits.html#parameter-patterns
27+
-->
28+
29+
[トレイト関数のパラメータ]: https://doc.rust-lang.org/stable/reference/items/traits.html#parameter-patterns
1030

1131

32+
<!--
1233
## Details
34+
-->
1335

36+
## 詳細
37+
38+
<!--
1439
In accordance with RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685),
1540
parameters in trait method declarations are no longer allowed to be anonymous.
41+
-->
42+
43+
RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685)に基づいて、トレイト関数のパラメータを匿名にすることはできなくなりました。
1644

45+
<!--
1746
For example, in the 2015 edition, this was allowed:
47+
-->
48+
49+
例えば、2015 エディションでは、以下のように書けました:
1850

1951
```rust
2052
trait Foo {
2153
fn foo(&self, u8);
2254
}
2355
```
2456

57+
<!--
2558
In the 2018 edition, all parameters must be given an argument name (even if it's just
2659
`_`):
60+
-->
61+
62+
2018 エディションでは、すべての引数名に(ただの `_` であってもいいので、何らかの)名前がついていなければなりません:
2763

2864
```rust
2965
trait Foo {

0 commit comments

Comments
 (0)