File tree Expand file tree Collapse file tree 3 files changed +38
-1
lines changed
Expand file tree Collapse file tree 3 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 3030| binary | バイナリ
3131| binding | 束縛
3232| block | ブロック
33+ | body (関数の) | 本体
3334| borrowing | 借用
3435| bounds | 境界
3536| boxed | ボックス化された
Original file line number Diff line number Diff line change 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 )
Original file line number Diff line number Diff line change 1+ <!--
12# Anonymous trait function parameters deprecated
3+ -->
24
5+ # トレイト関数の匿名パラメータの非推奨化
6+
7+ <!--
38
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+ <!--
1439In accordance with RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685),
1540parameters 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+ <!--
1746For example, in the 2015 edition, this was allowed:
47+ -->
48+
49+ 例えば、2015 エディションでは、以下のように書けました:
1850
1951``` rust
2052trait Foo {
2153 fn foo (& self , u8 );
2254}
2355```
2456
57+ <!--
2558In the 2018 edition, all parameters must be given an argument name (even if it's just
2659`_`):
60+ -->
61+
62+ 2018 エディションでは、すべての引数名に(ただの ` _ ` であってもいいので、何らかの)名前がついていなければなりません:
2763
2864``` rust
2965trait Foo {
You can’t perform that action at this time.
0 commit comments