File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -2686,8 +2686,8 @@ fn add(x: int, y: int) -> int {
26862686
26872687let mut x = add(5,7);
26882688
2689- type binop = fn(int,int) -> int;
2690- let bo: binop = add;
2689+ type Binop = fn(int,int) -> int;
2690+ let bo: Binop = add;
26912691x = bo(5,7);
26922692~~~~~~~~
26932693
@@ -2697,24 +2697,24 @@ Every trait item (see [traits](#traits)) defines a type with the same name
26972697as the trait. For a trait ` T ` , cast expressions introduce values of type ` T ` :
26982698
26992699~~~~~~~~
2700- trait printable {
2700+ trait Printable {
27012701 fn to_str() -> ~str;
27022702}
27032703
2704- impl ~str: printable {
2704+ impl ~str: Printable {
27052705 fn to_str() -> ~str { self }
27062706}
27072707
2708- fn print(a: printable ) {
2708+ fn print(a: Printable ) {
27092709 io::println(a.to_str());
27102710}
27112711
27122712fn main() {
2713- print(~"meow" as printable );
2713+ print(~"meow" as ~Printable );
27142714}
27152715~~~~~~~~
27162716
2717- In this example, the trait ` printable ` occurs as a type in both the type signature of
2717+ In this example, the trait ` Printable ` occurs as a type in both the type signature of
27182718` print ` , and the cast expression in ` main ` .
27192719
27202720### Type parameters
@@ -2740,16 +2740,16 @@ impl item. It refers to the type of the implicit `self` argument. For
27402740example, in:
27412741
27422742~~~~~~
2743- trait printable {
2743+ trait Printable {
27442744 fn to_str() -> ~str;
27452745}
27462746
2747- impl ~str: printable {
2747+ impl ~str: Printable {
27482748 fn to_str() -> ~str { self }
27492749}
27502750~~~~~~
27512751
2752- ` self ` refers to the value of type ` str ` that is the receiver for a
2752+ ` self ` refers to the value of type ` ~ str` that is the receiver for a
27532753call to the method ` to_str ` .
27542754
27552755## Type kinds
You can’t perform that action at this time.
0 commit comments