@@ -40,17 +40,17 @@ overload that operator is listed.
40
40
|----------|---------|-------------|---------------|
41
41
| `!` | `ident!(...)`, `ident!{...}`, `ident![...]` | Macro expansion | |
42
42
| `!` | `!expr` | Bitwise or logical complement | `Not` |
43
- | `!=` | `var != expr` | Nonequality comparison | `PartialEq` |
43
+ | `!=` | `expr != expr` | Nonequality comparison | `PartialEq` |
44
44
| `%` | `expr % expr` | Arithmetic remainder | `Rem` |
45
45
| `%=` | `var %= expr` | Arithmetic remainder and assignment | `RemAssign` |
46
46
| `&` | `&expr`, `&mut expr` | Borrow | |
47
47
| `&` | `&type`, `&mut type`, `&'a type`, `&'a mut type` | Borrowed pointer type | |
48
48
| `&` | `expr & expr` | Bitwise AND | `BitAnd` |
49
49
| `&=` | `var &= expr` | Bitwise AND and assignment | `BitAndAssign` |
50
- | `&&` | `expr && expr` | Logical AND | |
50
+ | `&&` | `expr && expr` | Short-circuiting logical AND | |
51
51
| `*` | `expr * expr` | Arithmetic multiplication | `Mul` |
52
52
| `*=` | `var *= expr` | Arithmetic multiplication and assignment | `MulAssign` |
53
- | `*` | `*expr` | Dereference | |
53
+ | `*` | `*expr` | Dereference | `Deref` |
54
54
| `*` | `*const type`, `*mut type` | Raw pointer | |
55
55
| `+` | `trait + trait`, `'a + trait` | Compound type constraint | |
56
56
| `+` | `expr + expr` | Arithmetic addition | `Add` |
@@ -59,12 +59,13 @@ overload that operator is listed.
59
59
| `-` | `- expr` | Arithmetic negation | `Neg` |
60
60
| `-` | `expr - expr` | Arithmetic subtraction | `Sub` |
61
61
| `-=` | `var -= expr` | Arithmetic subtraction and assignment | `SubAssign` |
62
- | `->` | `fn(...) -> type`, <code>\| ...\| -> type</code> | Function and closure return type | |
62
+ | `->` | `fn(...) -> type`, <code>| ...| -> type</code> | Function and closure return type | |
63
63
| `.` | `expr.ident` | Member access | |
64
- | `..` | `..`, `expr..`, `..expr`, `expr..expr` | Right-exclusive range literal | |
64
+ | `..` | `..`, `expr..`, `..expr`, `expr..expr` | Right-exclusive range literal | `PartialOrd` |
65
+ | `..=` | `..=expr`, `expr..=expr` | Right-inclusive range literal | `PartialOrd` |
65
66
| `..` | `..expr` | Struct literal update syntax | |
66
67
| `..` | `variant(x, ..)`, `struct_type { x, .. }` | “And the rest” pattern binding | |
67
- | `...` | `expr...expr` | In a pattern: inclusive range pattern | |
68
+ | `...` | `expr...expr` | (Deprecated, use `..=` instead) In a pattern: inclusive range pattern | |
68
69
| `/` | `expr / expr` | Arithmetic division | `Div` |
69
70
| `/=` | `var /= expr` | Arithmetic division and assignment | `DivAssign` |
70
71
| `:` | `pat: type`, `ident: type` | Constraints | |
@@ -86,27 +87,27 @@ overload that operator is listed.
86
87
| `@` | `ident @ pat` | Pattern binding | |
87
88
| `^` | `expr ^ expr` | Bitwise exclusive OR | `BitXor` |
88
89
| `^=` | `var ^= expr` | Bitwise exclusive OR and assignment | `BitXorAssign` |
89
- | <code>\| </code> | <code>pat \| pat</code> | Pattern alternatives | |
90
- | <code>\| </code> | <code>expr \| expr</code> | Bitwise OR | `BitOr` |
91
- | <code>\| =</code> | <code>var \| = expr</code> | Bitwise OR and assignment | `BitOrAssign` |
92
- | <code>\|\| </code> | <code>expr \|\| expr</code> | Logical OR | |
90
+ | <code>| </code> | <code>pat | pat</code> | Pattern alternatives | |
91
+ | <code>| </code> | <code>expr | expr</code> | Bitwise OR | `BitOr` |
92
+ | <code>| =</code> | <code>var | = expr</code> | Bitwise OR and assignment | `BitOrAssign` |
93
+ | <code>|| </code> | <code>expr || expr</code> | Short-circuiting logical OR | |
93
94
| `?` | `expr?` | Error propagation | |
94
95
-->
95
96
96
97
| 演算子 | 例 | 説明 | オーバーロードできる? |
97
98
| -------------------| --------------------------------------------------| --------------------------| ---------------------|
98
99
| ` ! ` | ` ident!(...) ` , ` ident!{...} ` , ` ident![...] ` | マクロ展開 ||
99
100
| ` ! ` | ` !expr ` | ビット反転、または論理反転 | ` Not ` |
100
- | ` != ` | ` var != expr` | 非等価比較 | ` PartialEq ` |
101
+ | ` != ` | ` expr != expr` | 非等価比較 | ` PartialEq ` |
101
102
| ` % ` | ` expr % expr ` | 余り演算 | ` Rem ` |
102
103
| ` %= ` | ` var %= expr ` | 余り演算後に代入 | ` RemAssign ` |
103
104
| ` & ` | ` &expr ` , ` &mut expr ` | 借用 ||
104
105
| ` & ` | ` &type ` , ` &mut type ` , ` &'a type ` , ` &'a mut type ` | 借用されたポインタ型 ||
105
106
| ` & ` | ` expr & expr ` | ビットAND | ` BitAnd ` |
106
107
| ` &= ` | ` var &= expr ` | ビットAND後に代入 | ` BitAndAssign ` |
107
- | ` && ` | ` expr && expr ` | 論理AND ||
108
+ | ` && ` | ` expr && expr ` | 短絡論理AND ||
108
109
| ` * ` | ` expr * expr ` | 掛け算 | ` Mul ` |
109
- | ` * ` | ` *expr ` | 参照外し ||
110
+ | ` * ` | ` *expr ` | 参照外し | ` Deref ` |
110
111
| ` * ` | ` *const type ` , ` *mut type ` | 生ポインタ ||
111
112
| ` *= ` | ` var *= expr ` | 掛け算後に代入 | ` MulAssign ` |
112
113
| ` + ` | ` trait + trait ` , ` 'a + trait ` | 型制限の複合化 ||
@@ -116,12 +117,13 @@ overload that operator is listed.
116
117
| ` - ` | ` - expr ` | 算術否定 | ` Neg ` |
117
118
| ` - ` | ` expr - expr ` | 引き算 | ` Sub ` |
118
119
| ` -= ` | ` var -= expr ` | 引き算後に代入 | ` SubAssign ` |
119
- | ` -> ` | ` fn(...) -> type ` , <code >\| ...\| -> type</code > | 関数とクロージャの戻り値型 ||
120
+ | ` -> ` | ` fn(...) -> type ` , <code >& vert ; ...& vert ; -> type</code > | 関数とクロージャの戻り値型 ||
120
121
| ` . ` | ` expr.ident ` | メンバーアクセス ||
121
- | ` .. ` | ` .. ` , ` expr.. ` , ` ..expr ` , ` expr..expr ` | 未満範囲リテラル ||
122
+ | ` .. ` | ` .. ` , ` expr.. ` , ` ..expr ` , ` expr..expr ` | 未満範囲リテラル | ` PartialOrd ` |
123
+ | ` ..= ` | ` ..=expr ` , ` expr..=expr ` | 以下範囲リテラル | ` PartialOrd ` |
122
124
| ` .. ` | ` ..expr ` | 構造体リテラル更新記法 ||
123
125
| ` .. ` | ` variant(x, ..) ` , ` struct_type { x, .. } ` | 「残り全部」パターン束縛 ||
124
- | ` ... ` | ` expr...expr ` | パターンで: 以下範囲パターン ||
126
+ | ` ... ` | ` expr...expr ` | (非推奨、代わりに ` ..= ` を使用してください) パターンで: 以下範囲パターン ||
125
127
| ` / ` | ` expr / expr ` | 割り算 | ` Div ` |
126
128
| ` /= ` | ` var /= expr ` | 割り算後に代入 | ` DivAssign ` |
127
129
| ` : ` | ` pat: type ` , ` ident: type ` | 型制約 ||
@@ -143,11 +145,11 @@ overload that operator is listed.
143
145
| ` @ ` | ` ident @ pat ` | パターン束縛 ||
144
146
| ` ^ ` | ` expr ^ expr ` | ビットXOR | ` BitXor ` |
145
147
| ` ^= ` | ` var ^= expr ` | ビットXOR後に代入 | ` BitXorAssign ` |
146
- | <code >\| </code > | <code >pat \| pat</code > | パターンOR ||
147
- | <code >\| </code > | <code >\| … \| expr</code > | クロージャ ||
148
- | <code >\| </code > | <code >expr \| expr</code > | ビットOR | ` BitOr ` |
149
- | <code >\| =</code > | <code >var \| = expr</code > | ビットOR後に代入 | ` BitOrAssign ` |
150
- | <code >\|\| </code > | <code >expr \|\| expr</code > | 論理OR ||
148
+ | <code >& vert ; </code > | <code >pat & vert ; pat</code > | パターンOR ||
149
+ | <code >& vert ; </code > | <code >& vert ; … & vert ; expr</code > | クロージャ ||
150
+ | <code >& vert ; </code > | <code >expr & vert ; expr</code > | ビットOR | ` BitOr ` |
151
+ | <code >& vert ; =</code > | <code >var & vert ; = expr</code > | ビットOR後に代入 | ` BitOrAssign ` |
152
+ | <code >& vert ;& vert ; </code > | <code >expr & vert ;& vert ; expr</code > | 短絡論理OR ||
151
153
| ` ? ` | ` expr? ` | エラー委譲 ||
152
154
153
155
<!--
@@ -157,8 +159,8 @@ overload that operator is listed.
157
159
### 演算子以外のシンボル
158
160
159
161
<!--
160
- The following list contains all non-letters that don’t function as operators;
161
- that is, they don’t behave like a function or method call.
162
+ The following list contains all symbols that don’t function as operators; that
163
+ is, they don’t behave like a function or method call.
162
164
-->
163
165
164
166
以下のリストは、演算子として機能しない記号全部を含んでいます; つまり、関数やメソッド呼び出しのようには、
@@ -184,11 +186,11 @@ locations.
184
186
| `...u8`, `...i32`, `...f64`, `...usize`, etc. | Numeric literal of specific type |
185
187
| `"..."` | String literal |
186
188
| `r"..."`, `r#"..."#`, `r##"..."##`, etc. | Raw string literal, escape characters not processed |
187
- | `b"..."` | Byte string literal; constructs a `[u8]` instead of a string |
189
+ | `b"..."` | Byte string literal; constructs an array of bytes instead of a string |
188
190
| `br"..."`, `br#"..."#`, `br##"..."##`, etc. | Raw byte string literal, combination of raw and byte string literal |
189
191
| `'...'` | Character literal |
190
192
| `b'...'` | ASCII byte literal |
191
- | <code>\| ...\| expr</code> | Closure |
193
+ | <code>| ...| expr</code> | Closure |
192
194
| `!` | Always empty bottom type for diverging functions |
193
195
| `_` | “Ignored” pattern binding; also used to make integer literals readable |
194
196
-->
@@ -199,11 +201,11 @@ locations.
199
201
| ` ...u8 ` , ` ...i32 ` , ` ...f64 ` , ` ...usize ` など | 特定の型の数値リテラル |
200
202
| ` "..." ` | 文字列リテラル|
201
203
| ` r"..." ` , ` r#"..."# ` , ` r##"..."## ` など | 生文字列リテラル、エスケープ文字は処理されません |
202
- | ` b"..." ` | バイト文字列リテラル、文字列の代わりに ` [u8] ` を構築します |
204
+ | ` b"..." ` | バイト文字列リテラル、文字列の代わりにバイト列を構築します |
203
205
| ` br"..." ` , ` br#"..."# ` , ` br##"..."## ` など | 生バイト文字列リテラル、生文字列とバイト文字列の組み合わせ |
204
206
| ` '...' ` | 文字リテラル |
205
207
| ` b'...' ` | ASCIIバイトリテラル |
206
- | <code >\| ...\| expr</code > | クロージャ |
208
+ | <code >& vert ; ...& vert ; expr</code > | クロージャ |
207
209
| ` ! ` | 常に発散関数の空のボトム型 |
208
210
| ` _ ` | 「無視」パターン束縛: 整数リテラルを見やすくするのにも使われる|
209
211
@@ -301,7 +303,7 @@ parameters with trait bounds.
301
303
|--------|-------------|
302
304
| `T: U` | Generic parameter `T` constrained to types that implement `U` |
303
305
| `T: 'a` | Generic type `T` must outlive lifetime `'a` (meaning the type cannot transitively contain any references with lifetimes shorter than `'a`) |
304
- | `T : 'static` | Generic type `T` contains no borrowed references other than `'static` ones |
306
+ | `T: 'static` | Generic type `T` contains no borrowed references other than `'static` ones |
305
307
| `'b: 'a` | Generic lifetime `'b` must outlive lifetime `'a` |
306
308
| `T: ?Sized` | Allow generic type parameter to be a dynamically sized type |
307
309
| `'a + trait`, `trait + trait` | Compound type constraint |
@@ -311,7 +313,7 @@ parameters with trait bounds.
311
313
| -------------------------------| -----|
312
314
| ` T: U ` | ` U ` を実装する型に制約されるジェネリック引数` T ` |
313
315
| ` T: 'a ` | ライフタイム` 'a ` よりも長生きしなければならないジェネリック型` T ` (型がライフタイムより長生きするとは、` 'a ` よりも短いライフタイムの参照を何も遷移的に含められないことを意味する)|
314
- | ` T : 'static ` | ジェネリック型` T ` が` 'static ` なもの以外の借用された参照を何も含まない |
316
+ | ` T: 'static ` | ジェネリック型` T ` が` 'static ` なもの以外の借用された参照を何も含まない |
315
317
| ` 'b: 'a ` | ジェネリックなライフタイム` 'b ` がライフタイム` 'a ` より長生きしなければならない |
316
318
| ` T: ?Sized ` | ジェネリック型引数が動的サイズ決定型であることを許容する |
317
319
| ` 'a + trait ` , ` trait + trait ` | 複合型制約 |
@@ -337,6 +339,7 @@ macros and specifying attributes on an item.
337
339
| `$ident` | Macro substitution |
338
340
| `$ident:kind` | Macro capture |
339
341
| `$(…)…` | Macro repetition |
342
+ | `ident!(...)`, `ident!{...}`, `ident![...]` | Macro invocation |
340
343
-->
341
344
342
345
| シンボル | 説明 |
@@ -346,6 +349,7 @@ macros and specifying attributes on an item.
346
349
| ` $ident ` | マクロ代用 |
347
350
| ` $ident:kind ` | マクロキャプチャ |
348
351
| ` $(…)… ` | マクロの繰り返し |
352
+ | ` ident!(...) ` , ` ident!{...} ` , ` ident![...] ` | マクロ呼び出し |
349
353
350
354
<!--
351
355
Table B-7 shows symbols that create comments.
@@ -407,7 +411,6 @@ Table B-8 shows symbols that appear in the context of using tuples.
407
411
| `(expr, ...)` | Tuple expression |
408
412
| `(type, ...)` | Tuple type |
409
413
| `expr(expr, ...)` | Function call expression; also used to initialize tuple `struct`s and tuple `enum` variants |
410
- | `ident!(...)`, `ident!{...}`, `ident![...]` | Macro invocation |
411
414
| `expr.0`, `expr.1`, etc. | Tuple indexing |
412
415
-->
413
416
@@ -420,7 +423,6 @@ Table B-8 shows symbols that appear in the context of using tuples.
420
423
| ` (expr, ...) ` | タプル式 |
421
424
| ` (type, ...) ` | タプル型 |
422
425
| ` expr(expr, ...) ` | 関数呼び出し式; タプル` struct ` やタプル` enum ` 列挙子を初期化するのにも使用される |
423
- | ` ident!(...) ` , ` ident!{...} ` , ` ident![...] ` | マクロ呼び出し |
424
426
| ` expr.0 ` , ` expr.1 ` , など | タプル添え字アクセス |
425
427
426
428
<!--
0 commit comments