1784 Commits

Author SHA1 Message Date
David Tolnay
d8ad970270
Extract derive implementations to module 2020-11-27 12:44:05 -08:00
David Tolnay
f3b89fb23a
Preserve span of fields in derived Clone impl 2020-11-27 12:32:30 -08:00
David Tolnay
4d73379753
Add ui test of derives that fail due to field types 2020-11-27 12:24:22 -08:00
David Tolnay
b247df1d26
Preserve span on Derive trait impls 2020-11-27 12:20:49 -08:00
David Tolnay
4a0c53a7b0
Expand derives manually where allowed 2020-11-27 12:19:33 -08:00
David Tolnay
652cb50e33
Add test of duplicate derive on struct 2020-11-27 12:19:29 -08:00
David Tolnay
1c534cfdc1
Release 1.0.5 1.0.5 2020-11-25 21:30:22 -08:00
David Tolnay
01a5df6a32
Merge pull request #517 from dtolnay/striterator
Add String and Str iterators
2020-11-25 21:11:34 -08:00
David Tolnay
ff7f5fb8cc
Add String and Str iterators 2020-11-25 21:06:33 -08:00
David Tolnay
01ef29a15c
Hide full iterator API from rendered documentation 2020-11-25 20:44:31 -08:00
David Tolnay
a829be62df
Exhaustive match to ensure no missing prints for includes 2020-11-25 20:41:12 -08:00
David Tolnay
d1df4c7621
Include <iterator> for input_iterator_tag 2020-11-25 20:38:16 -08:00
David Tolnay
450d8cdd72
Add Slice dependency on type_traits for is_const, add_pointer 2020-11-25 20:38:16 -08:00
David Tolnay
474f188828
Merge pull request #516 from dtolnay/sliceiterator
Add iterator for rust::Slice
2020-11-25 20:38:08 -08:00
David Tolnay
e0b03286eb
Show slice iterator in book 2020-11-25 20:32:03 -08:00
David Tolnay
ac6cb54e3b
Add iterator for rust::Slice 2020-11-25 20:27:32 -08:00
David Tolnay
7b16a39a02
Consider T alignment for empty rust::Slice 2020-11-25 20:23:14 -08:00
David Tolnay
71c7b45e4f
Merge pull request #515 from dtolnay/c_char
Support c_char type
2020-11-25 20:22:58 -08:00
David Tolnay
93e71d0b46
Support Vec<c_char> 2020-11-25 20:16:52 -08:00
David Tolnay
36bd61615d
Update tests to use c_char where appropriate 2020-11-25 20:13:05 -08:00
David Tolnay
b3873dcd10
Support c_char type 2020-11-25 20:04:09 -08:00
David Tolnay
248215e206
Replace uint8_t with char for byte-based computations in Vec iterator 2020-11-25 19:41:16 -08:00
David Tolnay
2923080472
Merge pull request #514 from dtolnay/slice
Generalize SliceRef codegen to non-u8 element type
2020-11-25 19:41:06 -08:00
David Tolnay
5515a9e820
Generalize SliceRef codegen to non-u8 element type 2020-11-25 19:34:42 -08:00
David Tolnay
85ef67a70f
Match the user's mut on slice error 2020-11-25 17:51:35 -08:00
David Tolnay
69db81496c
Move slice validation to type checker 2020-11-25 17:49:40 -08:00
David Tolnay
73b7264eb0
Generalize Type::SliceRefU8 to Type::SliceRef 2020-11-25 17:44:10 -08:00
David Tolnay
e0dca7b994
Remove Type::Slice from syntax tree
Slices were considered illegal in most positions except as the target of
a reference, which led to confusing code in the code generators. This
commit replaces their syntax tree representation from
Type::Ref(Type::Slice(...)) to Type::SliceRef(...).
2020-11-25 17:38:54 -08:00
David Tolnay
da2558ec92
Reject array containing &str or &[u8] for now
This is blocked on making slices' data() and size() call into Rust to
deconstruct the fat pointer, which is TODO.
2020-11-25 17:16:14 -08:00
David Tolnay
817f09e832
Fn makes more sense to treat like unsized 2020-11-25 16:59:17 -08:00
David Tolnay
7c06b86fdb
Format with rustfmt 1.4.27-nightly 2020-11-25 16:59:17 -08:00
David Tolnay
4b52066c72
Merge pull request #513 from dtolnay/opaque
Add common base class for opaque Rust types
2020-11-25 16:32:28 -08:00
David Tolnay
a857c32d40
Public deleted Opaque special members to resolve modernize-use-equals-delete
include/cxx.h:303:3: warning: deleted member function should be public [modernize-use-equals-delete]
      Opaque() = delete;
      ^
    include/cxx.h:304:3: warning: deleted member function should be public [modernize-use-equals-delete]
      Opaque(const Opaque &) = delete;
      ^
    include/cxx.h:305:3: warning: deleted member function should be public [modernize-use-equals-delete]
      ~Opaque() = delete;
      ^
2020-11-25 16:27:25 -08:00
David Tolnay
365fc7c66a
Add common base class for opaque Rust types 2020-11-25 16:22:54 -08:00
David Tolnay
f520e20cfc
Merge pull request #512 from dtolnay/arrayzero
Disallow array with zero size
2020-11-25 16:07:18 -08:00
David Tolnay
581f72dc8f
Disallow array with zero size 2020-11-25 16:00:03 -08:00
David Tolnay
bc8e027663
Merge pull request #511 from dtolnay/fielderr
Allow simultaneous diagnostics on multiple fields of a struct
2020-11-25 15:58:45 -08:00
David Tolnay
38c1121df3
Allow simultaneous diagnostics on multiple fields of a struct 2020-11-25 15:50:19 -08:00
David Tolnay
819eeb7f5b
Convert array expr test to fields of a struct 2020-11-25 15:50:07 -08:00
David Tolnay
63b92f5530
Merge pull request #510 from dtolnay/iterator
Share type between Vec<T>::const_iterator and Vec<const T>::iterator
2020-11-25 14:46:29 -08:00
David Tolnay
a5d72c6b99
Share type between Vec<T>::const_iterator and Vec<const T>::iterator 2020-11-25 14:36:59 -08:00
David Tolnay
9578cf114d
Add static assertions on type equality of Vec iterators 2020-11-25 14:36:59 -08:00
David Tolnay
b004098cee
Add Vec cbegin/cend test 2020-11-25 14:29:15 -08:00
David Tolnay
3d5a25a496
Simplify irrelevant detail from documentation of Vec iterator API 2020-11-25 13:48:35 -08:00
David Tolnay
079f69a5e3
Merge pull request #509 from dtolnay/iterator
Add rust::Vec mutable iterator
2020-11-25 13:42:35 -08:00
David Tolnay
960b511adc
Add rust::Vec mutable iterator 2020-11-25 13:31:54 -08:00
David Tolnay
66f216c776
Move Vec<T>::const_iterator definition out of line 2020-11-25 13:25:52 -08:00
David Tolnay
216fed4a37
Release 1.0.4 1.0.4 2020-11-25 13:10:10 -08:00
David Tolnay
8abd492dc5
Merge pull request #508 from dtolnay/nobridge
Include filepath in no-bridge-found error
2020-11-25 13:07:20 -08:00
David Tolnay
2c642d82e3
Include filepath in no-bridge-found error 2020-11-25 12:56:39 -08:00