Commit graph

20 commits

Author SHA1 Message Date
Daniel Henry-Mantilla
2ebf5e6e2f Fix doctests 2019-10-30 15:44:55 +01:00
Daniel Henry-Mantilla
60671268c8 Improved MaybeUninit::get_{ref,mut} documentation 2019-10-29 23:56:04 +01:00
Nils Liberg
fd505d7fd5 Improve wording in documentation of MaybeUninit 2019-09-28 11:49:45 +02:00
bors
9e9a136fce Auto merge of #63575 - Centril:rollup-anlv9g5, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #62984 (Add lint for excess trailing semicolons)
 - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`)
 - #63490 (libsyntax: cleanup and refactor `pat.rs`)
 - #63507 (When needing type annotations in local bindings, account for impl Trait and closures)
 - #63509 (Point at the right enclosing scope when using `await` in non-async fn)
 - #63528 (syntax: Remove `DummyResult::expr_only`)
 - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`)
 - #63542 (Add NodeId for Arm, Field and FieldPat)
 - #63543 (Merge Variant and Variant_)
 - #63560 (move test that shouldn't be in test/run-pass/)
 - #63570 (Adjust tracking issues for `MaybeUninit<T>` gates)

Failed merges:

r? @ghost
2019-08-15 00:32:05 +00:00
Mazdak Farrokhzad
24693d70d6
Adjust tracking issues for MaybeUninit<T> gates 2019-08-14 20:07:37 +02:00
Mark Rousskov
2601c86487 Handle cfg(bootstrap) throughout 2019-08-14 05:39:53 -04:00
Ralf Jung
c5a63566d6 allow the lint if a few UB-demonstrating doc tests 2019-08-11 12:04:49 +02:00
Mazdak Farrokhzad
fb1f57e0e5
Rollup merge of #63034 - tmandry:reduce-generator-size-regressions, r=cramertj
Fix generator size regressions due to optimization

I tested the generator optimizations in #60187 and #61922 on the Fuchsia
build, and noticed that some small generators (about 8% of the async fns
in our build) increased in size slightly.

This is because in #60187 we split the fields into two groups, a
"prefix" non-overlap region and an overlap region, and lay them out
separately. This can introduce unnecessary padding bytes between the two
groups.

In every single case in the Fuchsia build, it was due to there being
only a single variant being used in the overlap region. This means that
we aren't doing any overlapping, period. So it's better to combine the
two regions into one and lay out all the fields at once, which is what
this change does.

r? @cramertj
cc @eddyb @Zoxc
2019-08-07 01:39:25 +02:00
Ralf Jung
1821414b7b clarify 2019-08-06 10:41:48 +02:00
Ralf Jung
1b9eb4ac4c be clear that 1-init Vec being valid (but not safe) is not a stable guarantee 2019-08-06 09:47:42 +02:00
Ralf Jung
e1875742d0 assume_init: warn about valid != safe 2019-08-05 20:13:59 +02:00
Bruce Mitchener
86633b6389 Fix typos in doc comments. 2019-08-02 01:36:36 +07:00
Tyler Mandry
6fae7f8071 Wrap promoted generator fields in MaybeUninit
This prevents uninhabited fields from "infecting" the abi and
largest_niche of the generator layout.

This fixes a latent bug, where an uninhabited field could be promoted to
the generator prefix and cause the entire generator to become
uninhabited.
2019-07-29 12:17:49 -07:00
Ralf Jung
f3abbf7103 tidy is being silly 2019-07-21 12:59:51 +02:00
Ralf Jung
4b47e78a16 use a const to hack around promotion limitations 2019-07-21 12:28:18 +02:00
Ralf Jung
e074db764a use const array repeat expressions for uninit_array 2019-07-19 14:47:56 +02:00
Andre Bogus
cb3aa4ce2c Less unsafe in the array example of MaybeUninit docs 2019-07-14 13:32:14 +02:00
Mark Rousskov
8a7dded1a2 Switch master to 1.38 2019-07-04 11:26:57 -04:00
Michael Bradshaw
0f9dc6c48e Make MaybeUninit #[repr(transparent)]
Tracking issue: #60405
2019-06-18 06:31:23 -07:00
Ralf Jung
1529067a04 split libcore::mem into multiple files 2019-05-29 10:00:13 +02:00