Commit Graph

47210 Commits

Author SHA1 Message Date
bors
293966694c Auto merge of #28816 - petrochenkov:unistruct, r=nrc
This patch uses the same data structures for structs and enum variants in AST and HIR. These changes in data structures lead to noticeable simplification in most of code dealing with them.
I didn't touch the top level, i.e. `ItemStruct` is still `ItemStruct` and not `ItemEnum` with one variant, like in the type checker.
As part of this patch, structures and variants get the `kind` field making distinction between "normal" structs, tuple structs and unit structs explicit instead of relying on the number of fields and presence of constructor `NodeId`. In particular, we can now distinguish empty tuple structs from unit structs, which was impossible before! Comprehensive tests for empty structs are added and some improvements to empty struct feature gates are made. Some tests don't pass due to issue https://github.com/rust-lang/rust/issues/28692 , they are still there for completeness, but are commented out.
This patch fixes issue mentioned in https://github.com/rust-lang/rust/issues/16819#issuecomment-139509861, now emptiness of tuple structs is checked after expansion.
It also touches https://github.com/rust-lang/rust/issues/28750 by providing span for visit_struct_def
cc https://github.com/rust-lang/rust/pull/28336

r? @nrc
2015-10-14 04:21:58 +00:00
bors
c0dc2cb81d Auto merge of #29026 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #28988, #28989, #28990, #28997, #29007, #29015
- Failed merges: #28906
2015-10-14 00:06:32 +00:00
Steve Klabnik
1537545133 Rollup merge of #29015 - dripton:master, r=alexcrichton
Just a single-character typo fix.
2015-10-13 13:09:53 -04:00
Steve Klabnik
53bec74bc5 Rollup merge of #29007 - dnwade:patch-2, r=alexcrichton
r? @steveklabnik
2015-10-13 13:09:53 -04:00
Steve Klabnik
7868fbd824 Rollup merge of #28997 - bezelga:master, r=steveklabnik
Fixing some words in the beginning of the Ownership system chapters.
2015-10-13 13:09:53 -04:00
Steve Klabnik
be76fb6410 Rollup merge of #28990 - ahmedcharles:libarena, r=nrc 2015-10-13 13:09:53 -04:00
Steve Klabnik
749e93d313 Rollup merge of #28989 - ahmedcharles:liballoc_system, r=nrc 2015-10-13 13:09:52 -04:00
Steve Klabnik
5ae9456629 Rollup merge of #28988 - ahmedcharles:liballoc_jemalloc, r=nrc 2015-10-13 13:09:52 -04:00
Vadim Petrochenkov
607b8c3892 Comment on the purpose(s) of NodeId in VariantData 2015-10-13 16:18:33 +03:00
Vadim Petrochenkov
46750d0409 Merge VariantData and VariantData_ 2015-10-13 15:19:27 +03:00
Vadim Petrochenkov
a5225cbe92 Fix rebase 2 2015-10-13 15:19:26 +03:00
Vadim Petrochenkov
40aa09e4c9 Merge struct fields and struct kind 2015-10-13 15:19:25 +03:00
Vadim Petrochenkov
30af54dede Dict -> Struct, StructDef -> VariantData, def -> data 2015-10-13 15:19:24 +03:00
Vadim Petrochenkov
f4e3851aa7 Fix rebase 2015-10-13 15:19:22 +03:00
Vadim Petrochenkov
b404ded15b Fix failing privacy test 2015-10-13 15:19:21 +03:00
Vadim Petrochenkov
8a12c19171 Test and gate empty structures and variants better 2015-10-13 15:19:20 +03:00
Vadim Petrochenkov
beda1f88a7 Provide span for visit_struct_def + remove some dead code 2015-10-13 15:19:19 +03:00
Vadim Petrochenkov
877c35e8a2 Remove now redundant NodeId from Variant 2015-10-13 15:19:18 +03:00
Vadim Petrochenkov
495566ee61 Decouple structure kinds from NodeIds 2015-10-13 15:19:17 +03:00
Vadim Petrochenkov
2314ab29c2 Unify structures and enum variants in HIR 2015-10-13 15:19:16 +03:00
Vadim Petrochenkov
ea47c2b6b3 Unify structures and enum variants in AST 2015-10-13 15:19:15 +03:00
David Ripton
07e0161106 Typo fix 2015-10-12 23:24:27 -04:00
bors
ec4362da56 Auto merge of #28993 - frewsxcv:regression-test-17336, r=alexcrichton
Closes #17336
2015-10-13 03:19:11 +00:00
bors
60c18c8f34 Auto merge of #28987 - ahmedcharles:liballoc, r=brson 2015-10-13 00:37:09 +00:00
Dan W.
6406dcb2c4 typo 2015-10-12 15:29:20 -07:00
bors
5c7dbf6c0e Auto merge of #28986 - ahmedcharles:error-index-generator, r=brson 2015-10-12 20:16:24 +00:00
Fabiano Beselga
086f6b803f Fix docs about borrowing and lifetimes 2015-10-12 13:58:21 -03:00
Corey Farwell
d98195b40c Add regression test for #17336
Closes #17336
2015-10-12 09:44:26 -04:00
bors
8aa621a996 Auto merge of #28914 - steveklabnik:doc_iterator, r=alexcrichton
This replaces what was there with a comprehensive overview.

Thanks to @hoverbear for suggesting that these docs needed improvement.
2015-10-12 13:40:46 +00:00
Steve Klabnik
1fbf8bb664 Write better module-level docs for std::iter
This replaces what was there with a comprehensive overview.
2015-10-12 09:40:48 -04:00
bors
843e528fd0 Auto merge of #28985 - ahmedcharles:driver, r=nrc 2015-10-12 08:11:40 +00:00
Ahmed Charles
f65dbb1dc4 Run rustfmt on error-index-generator. 2015-10-11 23:44:32 -07:00
Ahmed Charles
e49a9561dc Run rustfmt on driver. 2015-10-11 23:41:43 -07:00
Ahmed Charles
6fb4cb6cd3 Run rustfmt on liballoc_system. 2015-10-11 23:35:08 -07:00
Ahmed Charles
5ea1f9ffed Run rustfmt on liballoc_jemalloc. 2015-10-11 22:18:51 -07:00
Ahmed Charles
5dcd406188 Run rustfmt on liballoc. 2015-10-11 22:11:59 -07:00
Ahmed Charles
21bb0dcc12 Run rustfmt on libarena. 2015-10-11 19:33:51 -07:00
bors
81b3b27cf5 Auto merge of #28969 - chrisccerami:link_to_ffi_in_concurrency_chapter, r=steveklabnik 2015-10-11 23:20:28 +00:00
bors
c413bb4fff Auto merge of #28973 - nrc:match-source, r=Manishearth
r? @Manishearth
2015-10-11 21:35:48 +00:00
Nick Cameron
254a10b318 Properly set the MatchSource for for loops 2015-10-12 09:49:29 +13:00
bors
8fbb35b835 Auto merge of #28960 - barosl:home-temp-dir-doc, r=alexcrichton
This concern was raised by #28940.
2015-10-11 19:51:22 +00:00
bors
9dafceb1f9 Auto merge of #28948 - steveklabnik:gh28944, r=alexcrichton
"Crate features" isn't a thing in Rust, but you do need to add this line
to your crate root.

Fixes #28944
2015-10-11 18:06:51 +00:00
Chris C Cerami
42e3f1dfae Link to FFI in Concurrency chapter 2015-10-11 13:23:57 -04:00
bors
603582776a Auto merge of #28966 - ykomatsu:trpl, r=steveklabnik 2015-10-11 16:20:13 +00:00
bors
84ff665558 Auto merge of #28964 - eminence:docfix, r=sfackler
r? @steveklabnik
2015-10-11 14:32:45 +00:00
Yoshito Komatsu
9652fc1d49 Fix some typos 2015-10-11 22:38:44 +09:00
bors
db6c7124b4 Auto merge of #28965 - bluss:ptr-write-doc, r=huonw
core: Update the safety docs for core::ptr::write

Updated to reflect that not dropping a value is safe (but discouraged).
2015-10-11 11:45:26 +00:00
Ulrik Sverdrup
4dee42fe58 core: Update the safety docs for core::ptr::write
Updated to reflect that not dropping a value is safe (but discouraged).
2015-10-11 13:40:47 +02:00
Andrew Chin
dce58baff0 Trivial typo fix: from_utrf8 should be from_utf8 2015-10-10 23:33:43 -04:00
Barosl Lee
8667aa207b Clarify the behavior of std::env::home_dir and std::env::temp_dir
This concern was raised by #28940.
2015-10-11 09:46:23 +09:00