about summary refs log tree commit diff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-03-07 09:55:36 +0000
committerbors <bors@rust-lang.org>2016-03-07 09:55:36 +0000
commite079afa00b58f06de8e2a7596073045cd0983b7b (patch)
tree27dec24366d1a27e13ead81a1abc6e0642834468 /src/doc/reference.md
parent79f914fdb90b21e7ec4a224671df59357e5cc49d (diff)
parent559683cdedf09bc58c468ab5eb0d7b19e57aeb61 (diff)
downloadrust-e079afa00b58f06de8e2a7596073045cd0983b7b.tar.gz
rust-e079afa00b58f06de8e2a7596073045cd0983b7b.zip
Auto merge of #31664 - nodakai:reference-negation, r=steveklabnik
It would be great if someone could check my English.
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index c2b22ef3e72..a94609a8b0c 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -379,6 +379,10 @@ Examples of integer literals of various forms:
 0usize;                            // type usize
 ```
 
+Note that the Rust syntax considers `-1i8` as an application of the [unary minus
+operator](#unary-operator-expressions) to an integer literal `1i8`, rather than
+a single integer literal.
+
 ##### Floating-point literals
 
 A _floating-point literal_ has one of two forms:
@@ -2776,7 +2780,9 @@ Rust defines the following unary operators. They are all written as prefix opera
 before the expression they apply to.
 
 * `-`
-  : Negation. May only be applied to numeric types.
+  : Negation. Signed integer types and floating-point types support negation. It
+    is an error to apply negation to unsigned types; for example, the compiler
+    rejects `-1u32`.
 * `*`
   : Dereference. When applied to a [pointer](#pointer-types) it denotes the
     pointed-to location. For pointers to mutable locations, the resulting