@@ -944,9 +944,20 @@ fn foo<T>(x: T) where T: Debug {
944944```
945945
946946When a generic function is referenced, its type is instantiated based on the
947- context of the reference. For example, calling the ` iter ` function defined
948- above on ` [1, 2] ` will instantiate type parameter ` T ` with ` i32 ` , and require
949- the closure parameter to have type ` Fn(i32) ` .
947+ context of the reference. For example, calling the ` foo ` function here:
948+
949+ ```
950+ use std::fmt::Debug;
951+
952+ fn foo<T>(x: &[T]) where T: Debug {
953+ // details elided
954+ # ()
955+ }
956+
957+ foo(&[1, 2]);
958+ ```
959+
960+ will instantiate type parameter ` T ` with ` i32 ` .
950961
951962The type parameters can also be explicitly supplied in a trailing
952963[ path] ( #paths ) component after the function name. This might be necessary if
@@ -2768,22 +2779,24 @@ meaning of the operators on standard types is given here.
27682779Like the [ arithmetic operators] ( #arithmetic-operators ) , bitwise operators are
27692780syntactic sugar for calls to methods of built-in traits. This means that
27702781bitwise operators can be overridden for user-defined types. The default
2771- meaning of the operators on standard types is given here.
2782+ meaning of the operators on standard types is given here. Bitwise ` & ` , ` | ` and
2783+ ` ^ ` applied to boolean arguments are equivalent to logical ` && ` , ` || ` and ` != `
2784+ evaluated in non-lazy fashion.
27722785
27732786* ` & `
2774- : And .
2787+ : Bitwise AND .
27752788 Calls the ` bitand ` method of the ` std::ops::BitAnd ` trait.
27762789* ` | `
2777- : Inclusive or .
2790+ : Bitwise inclusive OR .
27782791 Calls the ` bitor ` method of the ` std::ops::BitOr ` trait.
27792792* ` ^ `
2780- : Exclusive or .
2793+ : Bitwise exclusive OR .
27812794 Calls the ` bitxor ` method of the ` std::ops::BitXor ` trait.
27822795* ` << `
27832796 : Left shift.
27842797 Calls the ` shl ` method of the ` std::ops::Shl ` trait.
27852798* ` >> `
2786- : Right shift.
2799+ : Right shift (arithmetic) .
27872800 Calls the ` shr ` method of the ` std::ops::Shr ` trait.
27882801
27892802#### Lazy boolean operators
0 commit comments