@@ -2007,110 +2007,110 @@ A complete list of the built-in language items follows:
20072007
20082008#### Built-in Traits
20092009
2010- ` send `
2010+ * ` send `
20112011 : Able to be sent across task boundaries.
2012- ` sized `
2012+ * ` sized `
20132013 : Has a size known at compile time.
2014- ` copy `
2014+ * ` copy `
20152015 : Types that do not move ownership when used by-value.
2016- ` share `
2016+ * ` share `
20172017 : Able to be safely shared between tasks when aliased.
2018- ` drop `
2018+ * ` drop `
20192019 : Have destructors.
20202020
20212021#### Operators
20222022
20232023These language items are traits:
20242024
2025- ` add `
2025+ * ` add `
20262026 : Elements can be added (for example, integers and floats).
2027- ` sub `
2027+ * ` sub `
20282028 : Elements can be subtracted.
2029- ` mul `
2029+ * ` mul `
20302030 : Elements can be multiplied.
2031- ` div `
2031+ * ` div `
20322032 : Elements have a division operation.
2033- ` rem `
2033+ * ` rem `
20342034 : Elements have a remainder operation.
2035- ` neg `
2035+ * ` neg `
20362036 : Elements can be negated arithmetically.
2037- ` not `
2037+ * ` not `
20382038 : Elements can be negated logically.
2039- ` bitxor `
2039+ * ` bitxor `
20402040 : Elements have an exclusive-or operation.
2041- ` bitand `
2041+ * ` bitand `
20422042 : Elements have a bitwise ` and ` operation.
2043- ` bitor `
2043+ * ` bitor `
20442044 : Elements have a bitwise ` or ` operation.
2045- ` shl `
2045+ * ` shl `
20462046 : Elements have a left shift operation.
2047- ` shr `
2047+ * ` shr `
20482048 : Elements have a right shift operation.
2049- ` index `
2049+ * ` index `
20502050 : Elements can be indexed.
2051- ` eq `
2051+ * ` eq `
20522052 : Elements can be compared for equality.
2053- ` ord `
2053+ * ` ord `
20542054 : Elements have a partial ordering.
2055- ` deref `
2055+ * ` deref `
20562056 : ` * ` can be applied, yielding a reference to another type
2057- ` deref_mut `
2057+ * ` deref_mut `
20582058 : ` * ` can be applied, yielding a mutable reference to another type
20592059
20602060
20612061These are functions:
20622062
2063- ` str_eq `
2063+ * ` str_eq `
20642064 : Compare two strings (` &str ` ) for equality.
2065- ` uniq_str_eq `
2065+ * ` uniq_str_eq `
20662066 : Compare two owned strings (` ~str ` ) for equality.
2067- ` strdup_uniq `
2067+ * ` strdup_uniq `
20682068 : Return a new unique string
20692069 containing a copy of the contents of a unique string.
20702070
20712071#### Types
20722072
2073- ` unsafe `
2073+ * ` unsafe `
20742074 : A type whose contents can be mutated through an immutable reference
2075- ` type_id `
2075+ * ` type_id `
20762076 : The type returned by the ` type_id ` intrinsic.
20772077
20782078#### Marker types
20792079
20802080These types help drive the compiler's analysis
20812081
2082- ` covariant_type `
2082+ * ` covariant_type `
20832083 : The type parameter should be considered covariant
2084- ` contravariant_type `
2084+ * ` contravariant_type `
20852085 : The type parameter should be considered contravariant
2086- ` invariant_type `
2086+ * ` invariant_type `
20872087 : The type parameter should be considered invariant
2088- ` covariant_lifetime `
2088+ * ` covariant_lifetime `
20892089 : The lifetime parameter should be considered covariant
2090- ` contravariant_lifetime `
2090+ * ` contravariant_lifetime `
20912091 : The lifetime parameter should be considered contravariant
2092- ` invariant_lifetime `
2092+ * ` invariant_lifetime `
20932093 : The lifetime parameter should be considered invariant
2094- ` no_send_bound `
2094+ * ` no_send_bound `
20952095 : This type does not implement "send", even if eligible
2096- ` no_copy_bound `
2096+ * ` no_copy_bound `
20972097 : This type does not implement "copy", even if eligible
2098- ` no_share_bound `
2098+ * ` no_share_bound `
20992099 : This type does not implement "share", even if eligible
2100- ` managed_bound `
2100+ * ` managed_bound `
21012101 : This type implements "managed"
21022102
2103- ` fail_ `
2103+ * ` fail_ `
21042104 : Abort the program with an error.
2105- ` fail_bounds_check `
2105+ * ` fail_bounds_check `
21062106 : Abort the program with a bounds check error.
2107- ` exchange_malloc `
2107+ * ` exchange_malloc `
21082108 : Allocate memory on the exchange heap.
2109- ` exchange_free `
2109+ * ` exchange_free `
21102110 : Free memory that was allocated on the exchange heap.
2111- ` malloc `
2111+ * ` malloc `
21122112 : Allocate memory on the managed heap.
2113- ` free `
2113+ * ` free `
21142114 : Free memory that was allocated on the managed heap.
21152115
21162116> ** Note:** This list is likely to become out of date. We should auto-generate it
@@ -2618,24 +2618,24 @@ Rust defines six symbolic unary operators.
26182618They are all written as prefix operators,
26192619before the expression they apply to.
26202620
2621- ` - `
2621+ * ` - `
26222622 : Negation. May only be applied to numeric types.
2623- ` * `
2623+ * ` * `
26242624 : Dereference. When applied to a [ pointer] ( #pointer-types ) it denotes the pointed-to location.
26252625 For pointers to mutable locations, the resulting [ lvalue] ( #lvalues-rvalues-and-temporaries ) can be assigned to.
26262626 On non-pointer types, it calls the ` deref ` method of the ` std::ops::Deref ` trait, or the
26272627 ` deref_mut ` method of the ` std::ops::DerefMut ` trait (if implemented by the type and required
26282628 for an outer expression that will or could mutate the dereference), and produces the
26292629 result of dereferencing the ` & ` or ` &mut ` borrowed pointer returned from the overload method.
26302630
2631- ` ! `
2631+ * ` ! `
26322632 : Logical negation. On the boolean type, this flips between ` true ` and
26332633 ` false ` . On integer types, this inverts the individual bits in the
26342634 two's complement representation of the value.
2635- ` ~ `
2635+ * ` ~ `
26362636 : [ Boxing] ( #pointer-types ) operators. Allocate a box to hold the value they are applied to,
26372637 and store the value in it. ` ~ ` creates an owned box.
2638- ` & `
2638+ * ` & `
26392639 : Borrow operator. Returns a reference, pointing to its operand.
26402640 The operand of a borrow is statically proven to outlive the resulting pointer.
26412641 If the borrow-checker cannot prove this, it is a compilation error.
@@ -2656,19 +2656,19 @@ defined in the `std::ops` module of the `std` library.
26562656This means that arithmetic operators can be overridden for user-defined types.
26572657The default meaning of the operators on standard types is given here.
26582658
2659- ` + `
2659+ * ` + `
26602660 : Addition and vector/string concatenation.
26612661 Calls the ` add ` method on the ` std::ops::Add ` trait.
2662- ` - `
2662+ * ` - `
26632663 : Subtraction.
26642664 Calls the ` sub ` method on the ` std::ops::Sub ` trait.
2665- ` * `
2665+ * ` * `
26662666 : Multiplication.
26672667 Calls the ` mul ` method on the ` std::ops::Mul ` trait.
2668- ` / `
2668+ * ` / `
26692669 : Quotient.
26702670 Calls the ` div ` method on the ` std::ops::Div ` trait.
2671- ` % `
2671+ * ` % `
26722672 : Remainder.
26732673 Calls the ` rem ` method on the ` std::ops::Rem ` trait.
26742674
@@ -2679,19 +2679,19 @@ are syntactic sugar for calls to methods of built-in traits.
26792679This means that bitwise operators can be overridden for user-defined types.
26802680The default meaning of the operators on standard types is given here.
26812681
2682- ` & `
2682+ * ` & `
26832683 : And.
26842684 Calls the ` bitand ` method of the ` std::ops::BitAnd ` trait.
2685- ` | `
2685+ * ` | `
26862686 : Inclusive or.
26872687 Calls the ` bitor ` method of the ` std::ops::BitOr ` trait.
2688- ` ^ `
2688+ * ` ^ `
26892689 : Exclusive or.
26902690 Calls the ` bitxor ` method of the ` std::ops::BitXor ` trait.
2691- ` << `
2691+ * ` << `
26922692 : Logical left shift.
26932693 Calls the ` shl ` method of the ` std::ops::Shl ` trait.
2694- ` >> `
2694+ * ` >> `
26952695 : Logical right shift.
26962696 Calls the ` shr ` method of the ` std::ops::Shr ` trait.
26972697
@@ -2712,22 +2712,22 @@ syntactic sugar for calls to built-in traits.
27122712This means that comparison operators can be overridden for user-defined types.
27132713The default meaning of the operators on standard types is given here.
27142714
2715- ` == `
2715+ * ` == `
27162716 : Equal to.
27172717 Calls the ` eq ` method on the ` std::cmp::Eq ` trait.
2718- ` != `
2718+ * ` != `
27192719 : Unequal to.
27202720 Calls the ` ne ` method on the ` std::cmp::Eq ` trait.
2721- ` < `
2721+ * ` < `
27222722 : Less than.
27232723 Calls the ` lt ` method on the ` std::cmp::Ord ` trait.
2724- ` > `
2724+ * ` > `
27252725 : Greater than.
27262726 Calls the ` gt ` method on the ` std::cmp::Ord ` trait.
2727- ` <= `
2727+ * ` <= `
27282728 : Less than or equal.
27292729 Calls the ` le ` method on the ` std::cmp::Ord ` trait.
2730- ` >= `
2730+ * ` >= `
27312731 : Greater than or equal.
27322732 Calls the ` ge ` method on the ` std::cmp::Ord ` trait.
27332733
@@ -3413,7 +3413,7 @@ All pointers in Rust are explicit first-class values.
34133413They can be copied, stored into data structures, and returned from functions.
34143414There are four varieties of pointer in Rust:
34153415
3416- Owning pointers (` ~ ` )
3416+ * Owning pointers (` ~ ` )
34173417 : These point to owned heap allocations (or "boxes") in the shared, inter-task heap.
34183418 Each owned box has a single owning pointer; pointer and pointee retain a 1:1 relationship at all times.
34193419 Owning pointers are written ` ~content ` ,
@@ -3422,7 +3422,7 @@ Owning pointers (`~`)
34223422 it involves allocating a new owned box and copying the contents of the old box into the new box.
34233423 Releasing an owning pointer immediately releases its corresponding owned box.
34243424
3425- References (` & ` )
3425+ * References (` & ` )
34263426 : These point to memory _ owned by some other value_ .
34273427 References arise by (automatic) conversion from owning pointers, managed pointers,
34283428 or by applying the borrowing operator ` & ` to some other value,
@@ -3435,7 +3435,7 @@ References (`&`)
34353435 with the exception of temporary values,
34363436 which are released when the last reference to them is released.
34373437
3438- Raw pointers (` * ` )
3438+ * Raw pointers (` * ` )
34393439 : Raw pointers are pointers without safety or liveness guarantees.
34403440 Raw pointers are written ` *content ` ,
34413441 for example ` *int ` means a raw pointer to an integer.
@@ -3609,24 +3609,24 @@ call to the method `make_string`.
36093609Types in Rust are categorized into kinds, based on various properties of the components of the type.
36103610The kinds are:
36113611
3612- ` Send `
3612+ * ` Send `
36133613 : Types of this kind can be safely sent between tasks.
36143614 This kind includes scalars, owning pointers, owned closures, and
36153615 structural types containing only other owned types.
36163616 All ` Send ` types are ` 'static ` .
3617- ` Copy `
3617+ * ` Copy `
36183618 : Types of this kind consist of "Plain Old Data"
36193619 which can be copied by simply moving bits.
36203620 All values of this kind can be implicitly copied.
36213621 This kind includes scalars and immutable references,
36223622 as well as structural types containing other ` Copy ` types.
3623- ` 'static `
3623+ * ` 'static `
36243624 : Types of this kind do not contain any references (except for
36253625 references with the ` static ` lifetime, which are allowed).
36263626 This can be a useful guarantee for code
36273627 that breaks borrowing assumptions
36283628 using [ ` unsafe ` operations] ( #unsafe-functions ) .
3629- ` Drop `
3629+ * ` Drop `
36303630 : This is not strictly a kind,
36313631 but its presence interacts with kinds:
36323632 the ` Drop ` trait provides a single method ` drop `
@@ -3638,7 +3638,7 @@ The kinds are:
36383638 before any of the values it owns run their destructors.
36393639 Only ` Send ` types can implement ` Drop ` .
36403640
3641- _ Default_
3641+ * _ Default_
36423642 : Types with destructors, closure environments,
36433643 and various other _ non-first-class_ types,
36443644 are not copyable at all.
0 commit comments