about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-10-14 04:21:58 +0000
committerbors <bors@rust-lang.org>2015-10-14 04:21:58 +0000
commit293966694c3c8e0c7028e8f54340fbc328d85bff (patch)
tree0c27cb6fd568cdb39da33c6d608bfe19c3c7af5d /src/rustllvm/RustWrapper.cpp
parentc0dc2cb81d29c051edba169f1527c149717f1c3f (diff)
parent607b8c38923878264980503227ff4911d0da5b4b (diff)
downloadrust-293966694c3c8e0c7028e8f54340fbc328d85bff.tar.gz
rust-293966694c3c8e0c7028e8f54340fbc328d85bff.zip
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 
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions