rust/src/libcore
bors 5aca7d6aef auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakis
The fix is straight-forward, but there are several changes
while fixing the issue.

1) disallow `mut` keyword when making a new struct

In code base, there are following code,

```rust
struct Foo { mut a: int };
let a = Foo { mut a: 1 };
```

This is because of structural record, which is
deprecated corrently (see issue #3089) In structural
record, `mut` keyword should be allowd to control
mutability. But without structural record, we don't
need to allow `mut` keyword while constructing struct.

2) disallow structural records in parser level
This is related to 1). With structural records, there
is an ambiguity between empty block and empty struct
To solve the problem, I change parser to stop parsing
structural records. I think this is not a problem,
because structural records are not compiled already.

Misc. issues

There is an ambiguity between empty struct vs. empty match stmt.
with following code,

```rust
match x{} {}
```

Two interpretation is possible, which is listed blow

```rust
match (x{}) {} //  matching with newly-constructed empty struct
(match x{}) {}  //  matching with empty enum(or struct) x
                //  and then empty block
```

It seems that there is no such code in rust code base, but
there is one test which uses empty match statement:
https://github.com/mozilla/rust/blob/incoming/src/test/run-pass/issue-3037.rs

All other cases could be distinguished with look-ahead,
but this can't be. One possible solution is wrapping with
parentheses when matching with an uninhabited type.

```rust
enum what { }
fn match_with_empty(x: what) -> ~str {
    match (x) { //use parentheses to remove the ambiguity
    }
}
```
2013-03-02 04:21:38 -08:00
..
iter-trait libcore: Get rid of move. 2013-02-15 02:49:54 -08:00
num Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00
task core: Move core::rt to core::unstable::lang 2013-03-01 17:27:14 -08:00
unstable core: Move core::rt to core::unstable::lang 2013-03-01 17:27:14 -08:00
at_vec.rs Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00
bool.rs librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
cast.rs libcore: Get rid of move. 2013-02-15 02:49:54 -08:00
cell.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
char.rs librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
cleanup.rs core: Move core::rt to core::unstable::lang 2013-03-01 17:27:14 -08:00
clone.rs librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
cmp.rs librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
comm.rs Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00
condition.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
container.rs rm each method from the Map trait 2013-02-07 22:04:35 -05:00
core.rc core: Move core::rt to core::unstable::lang 2013-03-01 17:27:14 -08:00
dlist.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
dvec.rs Remove REC, change related tests/docs 2013-03-02 12:57:05 +09:00
either.rs librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
flate.rs libcore: Get rid of move. 2013-02-15 02:49:54 -08:00
from_str.rs Make ~fn non-copyable, make &fn copyable, split barefn/closure types, 2013-02-07 05:53:30 -08:00
gc.rs core: Remove structural records from the rest of core, except pipes 2013-02-07 22:48:57 -08:00
hash.rs Hoist macro defs out of inner function 2013-02-26 10:26:42 -08:00
hashmap.rs Fix implicit leaks of imports throughout libraries 2013-02-28 18:00:34 -05:00
io.rs Remove legacy object creation mode, and convert remaining uses of it 2013-02-28 20:28:04 -05:00
iter-trait.rs librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
iter.rs librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
kinds.rs Register snapshots 2012-12-17 16:44:27 -08:00
libc.rs Make ~fn non-copyable, make &fn copyable, split barefn/closure types, 2013-02-07 05:53:30 -08:00
logging.rs Make ~fn non-copyable, make &fn copyable, split barefn/closure types, 2013-02-07 05:53:30 -08:00
managed.rs Put unique allocs in managed heap when they might contain managed boxes. 2013-02-21 23:01:17 -08:00
mutable.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
nil.rs librustc: Replace impl Type : Trait with impl Trait for Type. rs=implflipping 2013-02-14 14:44:12 -08:00
ops.rs Make ~fn non-copyable, make &fn copyable, split barefn/closure types, 2013-02-07 05:53:30 -08:00
option.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
os.rs auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakis 2013-03-02 04:21:38 -08:00
owned.rs libsyntax: Forbid ~mut and ~const. rs=demuting 2013-02-27 09:40:15 -08:00
path.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
pipes.rs Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00
prelude.rs Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00
ptr.rs auto merge of #5137 : yjh0502/rust/empty_struct, r=nikomatsakis 2013-03-02 04:21:38 -08:00
rand.rs Remove legacy object creation mode, and convert remaining uses of it 2013-02-28 20:28:04 -05:00
reflect.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
repr.rs Remove legacy object creation mode, and convert remaining uses of it 2013-02-28 20:28:04 -05:00
result.rs librustc: Mark all type implementations public. rs=impl-publicity 2013-02-28 11:32:24 -08:00
run.rs Remove legacy object creation mode, and convert remaining uses of it 2013-02-28 20:28:04 -05:00
stackwalk.rs Remove code that was awaiting a snapshot 2013-02-28 20:30:50 -08:00
str.rs core: Address XXX, make static constants for strings used when stringifying floats 2013-02-28 16:49:02 -08:00
sys.rs libcore: Get rid of move. 2013-02-15 02:49:54 -08:00
to_bytes.rs librustc: Forbid pub or priv before trait implementations 2013-02-27 09:40:16 -08:00
to_str.rs auto merge of #5098 : pkgw/rust/pr/issue4869, r=brson 2013-02-27 20:39:39 -08:00
tuple.rs librustc: Separate most trait bounds with '+'. rs=plussing 2013-02-20 21:14:20 -08:00
unicode.rs Make ~fn non-copyable, make &fn copyable, split barefn/closure types, 2013-02-07 05:53:30 -08:00
unstable.rs core: Move core::rt to core::unstable::lang 2013-03-01 17:27:14 -08:00
util.rs Turn old drop blocks into Drop traits 2013-02-27 19:14:19 -05:00
vec.rs Rename core::private to core::unstable. #4743 2013-03-01 14:55:47 -08:00