Skip to content

Commit d469212

Browse files
committed
auto merge of #5507 : graydon/rust/fixups2, r=graydon
Just some editing-to-reflect-reality on release notes and manual.
2 parents df171e4 + 5f7b72e commit d469212

File tree

4 files changed

+29
-24
lines changed

4 files changed

+29
-24
lines changed

RELEASES.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version 0.6 (March 2013)
22
---------------------------
33

4-
* ~??? changes, numerous bugfixes
4+
* ~2000 changes, numerous bugfixes
55

66
* TODO:
77
* Ord/Cmp
@@ -39,6 +39,8 @@ Version 0.6 (March 2013)
3939
* Newtype enums removed. Used tuple-structs.
4040
* Trait implementations no longer support visibility modifiers
4141
* Pattern matching over vectors improved and expanded
42+
* `const` renamed to `static` to correspond to lifetime name,
43+
and make room for future `static mut` unsafe mutable globals.
4244

4345
* Semantic changes
4446
* Types with owned pointers or custom destructors move by default,
@@ -52,8 +54,9 @@ Version 0.6 (March 2013)
5254
* Name resolution continues to be tweaked
5355
* Method visibility is inherited from the implementation declaration
5456
* Structural records have been removed
55-
* Many more types can be used in constants, including enums,
56-
`static lifetime pointers and vectors
57+
* Many more types can be used in static items, including enums
58+
'static-lifetime pointers and vectors
59+
* Pattern matching over vectors improved and expanded
5760
* Typechecking of closure types has been overhauled to
5861
improve inference and eliminate unsoundness
5962

@@ -85,6 +88,7 @@ Version 0.6 (March 2013)
8588
* Improved foreign function ABI implementation for x86, x86_64
8689
* Various memory usage improvements
8790
* Rust code may be embedded in foreign code under limited circumstances
91+
* Inline assembler supported by new asm!() syntax extension.
8892

8993
Version 0.5 (December 2012)
9094
---------------------------

doc/rust.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,8 @@ each of which may have some number of [attributes](#attributes) attached to it.
617617
## Items
618618

619619
~~~~~~~~ {.ebnf .gram}
620-
item : mod_item | fn_item | type_item | enum_item
621-
| const_item | trait_item | impl_item | foreign_mod_item ;
620+
item : mod_item | fn_item | type_item | struct_item | enum_item
621+
| static_item | trait_item | impl_item | foreign_mod_item ;
622622
~~~~~~~~
623623

624624
An _item_ is a component of a crate; some module items can be defined in crate
@@ -627,7 +627,7 @@ crate by a nested set of [modules](#modules). Every crate has a single
627627
"outermost" anonymous module; all further items within the crate have
628628
[paths](#paths) within the module tree of the crate.
629629

630-
Items are entirely determined at compile-time, remain constant during
630+
Items are entirely determined at compile-time, generally remain fixed during
631631
execution, and may reside in read-only memory.
632632

633633
There are several kinds of item:
@@ -637,7 +637,7 @@ There are several kinds of item:
637637
* [type definitions](#type-definitions)
638638
* [structures](#structures)
639639
* [enumerations](#enumerations)
640-
* [constants](#constants)
640+
* [static items](#static-items)
641641
* [traits](#traits)
642642
* [implementations](#implementations)
643643

@@ -1091,21 +1091,23 @@ a = Cat{ name: ~"Spotty", weight: 2.7 };
10911091
In this example, `Cat` is a _struct-like enum variant_,
10921092
whereas `Dog` is simply called an enum variant.
10931093

1094-
### Constants
1094+
### Static items
10951095

10961096
~~~~~~~~ {.ebnf .gram}
1097-
const_item : "const" ident ':' type '=' expr ';' ;
1097+
static_item : "static" ident ':' type '=' expr ';' ;
10981098
~~~~~~~~
10991099

1100-
A *constant* is a named value stored in read-only memory in a crate.
1101-
The value bound to a constant is evaluated at compile time.
1102-
Constants are declared with the `static` keyword.
1103-
A constant item must have an expression giving its definition.
1104-
The definition expression of a constant is limited to expression forms that can be evaluated at compile time.
1100+
A *static item* is a named _constant value_ stored in the global data section of a crate.
1101+
Immutable static items are stored in the read-only data section.
1102+
The constant value bound to a static item is, like all constant values, evaluated at compile time.
1103+
Static items have the `static` lifetime, which outlives all other lifetimes in a Rust program.
1104+
Static items are declared with the `static` keyword.
1105+
A static item must have a _constant expression_ giving its definition.
11051106

1106-
Constants must be explicitly typed. The type may be ```bool```, ```char```, a number, or a type derived from those primitive types.
1107-
The derived types are borrowed pointers, static arrays, tuples, and structs.
1108-
Borrowed pointers must be have the `'static` lifetime.
1107+
Static items must be explicitly typed.
1108+
The type may be ```bool```, ```char```, a number, or a type derived from those primitive types.
1109+
The derived types are borrowed pointers with the `'static` lifetime,
1110+
fixed-size arrays, tuples, and structs.
11091111

11101112
~~~~
11111113
static bit1: uint = 1 << 0;
@@ -1456,7 +1458,7 @@ The declared names may denote new slots or new items.
14561458

14571459
An _item declaration statement_ has a syntactic form identical to an
14581460
[item](#items) declaration within a module. Declaring an item -- a function,
1459-
enumeration, type, constant, trait, implementation or module -- locally
1461+
enumeration, structure, type, static, trait, implementation or module -- locally
14601462
within a statement block is simply a way of restricting its scope to a narrow
14611463
region containing all of its uses; it is otherwise identical in meaning to
14621464
declaring the item outside the statement block.

doc/tutorial-borrowed-ptr.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,10 @@ overwritten for the duration of the borrow. In fact, the compiler
468468
would accept the example we gave earlier. The example is safe because
469469
the shape pointer has type `&Shape`, which means "borrowed pointer to
470470
immutable memory containing a `shape`". If, however, the type of that
471-
pointer were `&const Shape` or `&mut Shape`, then the ref binding
472-
would be ill-typed. Just as with unique boxes, the compiler will
473-
permit `ref` bindings into data owned by the stack frame even if the
474-
data are mutable, but otherwise it requires that the data reside in
475-
immutable memory.
471+
pointer were `&mut Shape`, then the ref binding would be ill-typed.
472+
Just as with unique boxes, the compiler will permit `ref` bindings
473+
into data owned by the stack frame even if the data are mutable,
474+
but otherwise it requires that the data reside in immutable memory.
476475

477476
# Returning borrowed pointers
478477

doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ while count < 10 {
234234

235235
Although Rust can almost always infer the types of local variables, you
236236
can specify a variable's type by following it with a colon, then the type
237-
name. Constants, on the other hand, always require a type annotation.
237+
name. Static items, on the other hand, always require a type annotation.
238238

239239
~~~~
240240
static monster_factor: float = 57.8;

0 commit comments

Comments
 (0)