Commit Graph

72567 Commits

Author SHA1 Message Date
Jonathan S
da9791767b Remove unnecessary assert that unions have only one variant 2017-12-23 20:38:36 -06:00
Jonathan S
cbcf2ffe80 Never mark unions as uninhabited. Although I think this is wrong, it is certainly sound, and the general consensus seems to value not having footguns over some sort of aesthetic consistency. 2017-12-20 19:36:41 -06:00
Jonathan S
c1fe4a22b9 Only mark unions as uninhabited if all of their fields are uninhabited. Fixes #46845. 2017-12-19 17:24:38 -06:00
bors
b76f224af8 Auto merge of #45525 - MaikKlein:collector, r=eddyb
Move collector to librustc_mir::monomorphize

cc https://github.com/rust-lang/rust/issues/44334 and https://github.com/rust-lang/rust/issues/45276

* I moved the collector to rustc_mir

*  I renamed `TransItem` to `MonoItem`. _(I still need to fix up comments and variable names)_

* I got rid of `common.rs` and `monomorphize.rs` from `librustc_trans_utils`. I moved most of the functionality into `TyCtxt`. I realized that the `librustc_trans_utils::common.rs` was just copy pasted from `librustc_trans::common.rs`.

Should I also get rid of the `librustc_trans::common.rs` in this PR? Most of the functionality seems a bit useless, I decided to put some of it into `TyCtxt` but maybe that is not the correct action here.

Should I also get rid of `librustc_trans_utils` completely here? Or should I do it in a separate PR?
2017-12-19 01:34:50 +00:00
bors
e7db42fb5b Auto merge of #46808 - eddyb:issue-46769-quick, r=arielb1
rustc: ensure optimized enums have a properly aligned size.

Fixes #46769 by padding the optimized enums wrapping packed data as necessary.

Note that this is not the only way to solve this - on nightly, #46436 makes it easier to fix without adding new padding because of the replacement of `packed` flags with a non-redundant scheme.
But because it can't be backported, the optimal fix will be in a separate nightly-only PR (#46809).
2017-12-18 20:44:18 +00:00
Eduard-Mihai Burtescu
087f1c23a7 rustc: ensure optimized enums have a properly aligned size. 2017-12-18 21:31:52 +02:00
Maik Klein
6e78b66578 Add rustc_data_structures for trans_utils/lib.rs 2017-12-18 19:10:06 +02:00
Maik Klein
c847cf3f5e Fix incorrect rebase in collector::find_vtable_types 2017-12-18 19:10:01 +02:00
bors
b058dc0107 Auto merge of #46811 - michaelwoerister:depkind-is-input, r=nikomatsakis
incr.comp.: Mark DepKind node as input.

Fixes `euclid` on https://travis-ci.org/rust-icci.

r? @nikomatsakis
2017-12-18 16:48:37 +00:00
Ariel Ben-Yehuda
f6fcfa3915 normalize the results of tcx.type_of after substituting
Also remove `def_ty`, which was a footgun because it did not do the
above.
2017-12-18 17:08:50 +02:00
Maik Klein
88866b5c85 Update lockfile 2017-12-18 17:08:49 +02:00
Maik Klein
b48ba026fe Rename more functions from trans to monomorphize 2017-12-18 17:08:49 +02:00
Maik Klein
d4b372d6e2 Rename trans to monomorphize in comments 2017-12-18 17:08:49 +02:00
Maik Klein
45f8a3b30c Move partitioning.rs to rustc_mir 2017-12-18 17:08:49 +02:00
Maik Klein
116e43f73b Prefer type_of().substs over instance::ty() 2017-12-18 17:08:49 +02:00
Maik Klein
282b231af2 Move has_metadata back to context.rs 2017-12-18 17:08:49 +02:00
Maik Klein
6e94a7a91e Remove branch with has_metadata 2017-12-18 17:08:49 +02:00
Maik Klein
ab0f8fcdac Test with trans_apply_param_substs 2017-12-18 17:08:49 +02:00
Maik Klein
1df6f8321b Remove duplicated functions from trans::common.rs 2017-12-18 17:08:49 +02:00
Maik Klein
7996f63ce4 Move meta_data into TyS 2017-12-18 17:08:49 +02:00
Maik Klein
dfbb6e8640 Move instance related methods from TyCtxt to Instance 2017-12-18 17:08:49 +02:00
Maik Klein
d3c4142880 Fix some comments to refer to MonoItem 2017-12-18 17:08:49 +02:00
Maik Klein
c06e3aa446 Refactor paths to middle::trans to mir::mono 2017-12-18 17:08:49 +02:00
Maik Klein
ae468ab38b Move middle::trans.rs to mir::mono.rs 2017-12-18 17:08:49 +02:00
Maik Klein
09ad6ebd0b Rename mono_item.rs to item.rs 2017-12-18 17:08:49 +02:00
Maik Klein
28f7d223f4 Rename as_trans_item to as_mono_item 2017-12-18 17:08:49 +02:00
Maik Klein
17bfd74955 Rename more functions from trans to mono 2017-12-18 17:08:48 +02:00
Maik Klein
b9ab487a7a Rename TransItemExt to MonoItemExt 2017-12-18 17:08:48 +02:00
Maik Klein
531c27d805 Move common.rs functionality into TyCtxt 2017-12-18 17:08:48 +02:00
Maik Klein
98b9eba316 Rename TransItemCollectionMode to MonoItemCollectionMode 2017-12-18 17:08:48 +02:00
Maik Klein
1181f45813 Rename TransItem to MonoItem 2017-12-18 17:08:48 +02:00
Maik Klein
e579b067db Move trans_item and monomorphize to rustc_mir 2017-12-18 17:08:48 +02:00
Maik Klein
094c021218 Move collector to monomorphize 2017-12-18 17:08:48 +02:00
Michael Woerister
a3c3245e91 incr.comp.: Mark DepKind node as input. 2017-12-18 15:40:07 +01:00
bors
a3a7203e2c Auto merge of #46798 - Diggsey:debug-osstr, r=dtolnay
Add lossless debug implementation for unix OsStrs

Fixes #22766

Invalid utf8 byte sequences are replaced with `\xFF` style escape codes, while valid utf8 goes through the normal `Debug` implementation.

This is necessarily different from the windows Debug implementation, which uses `\u{xxxx}` style escape sequences for unpaired surrogates, but both implementations are consistent in that they are both lossless, and display invalid sequences in the way most similar to existing language syntax.

r? @dtolnay
2017-12-18 02:54:11 +00:00
Diggory Blake
8fac7d95bc Add lossless debug implementation for unix OsStrs 2017-12-18 01:52:56 +00:00
bors
dc39c31699 Auto merge of #46788 - petrochenkov:assocrecov, r=estebank
syntax: recovery for incorrect associated item paths like `[T; N]::clone`

cc https://github.com/rust-lang/rust/pull/44970
Fixes https://github.com/rust-lang/rust/issues/42187
r? @estebank
2017-12-17 21:00:27 +00:00
Vadim Petrochenkov
70e5c37319 syntax: recovery for incorrect associated item paths like [T; N]::clone 2017-12-17 19:00:50 +03:00
bors
3cc68bac7c Auto merge of #46436 - eddyb:unpacked, r=arielb1,oli-obk
Detect unaligned fields via `aggregate.align < field.align`, instead of a `packed` flag.

Closes #46423. cc @oli-obk
2017-12-17 15:46:00 +00:00
Eduard-Mihai Burtescu
799a83ca2f Mark miri as broken. 2017-12-17 16:34:54 +02:00
Eduard-Mihai Burtescu
7dc79cc49b miri: pass pointer alignments directly instead of contextually. 2017-12-17 16:34:54 +02:00
Eduard-Mihai Burtescu
08646c6c2c miri: use separate Pointer and Align instead of PtrAndAlign. 2017-12-17 16:34:54 +02:00
Eduard-Mihai Burtescu
ff080d389d miri: track the Align instead of packedness in PtrAndAlign. 2017-12-17 16:34:54 +02:00
Eduard-Mihai Burtescu
5cab0bf0ad rustc_trans: always require alignment for load/store/memcpy. 2017-12-17 16:34:54 +02:00
Eduard-Mihai Burtescu
16307465d5 rustc_trans: always keep track of the Align in LvalueRef. 2017-12-17 16:34:54 +02:00
Eduard-Mihai Burtescu
7c6f242ca8 rustc: don't track whether layouts are "packed". 2017-12-17 16:34:54 +02:00
bors
af57acef1c Auto merge of #46709 - Zoxc:par-merge, r=arielb1
Add sync module to rustc_data_structures

This PR is split out from https://github.com/rust-lang/rust/pull/45912, since github apparently can't handle such large PRs.

r? @arielb1
2017-12-17 13:15:40 +00:00
John Kåre Alsaker
970c613e4a Add sync module to rustc_data_structures 2017-12-17 14:14:51 +01:00
bors
53a6d14e5b Auto merge of #46778 - petrochenkov:nounwrap, r=arielb1
syntax: Rename `P::unwrap` into something less alarming
2017-12-17 04:23:55 +00:00
bors
35376587c8 Auto merge of #46761 - zackmdavis:concerning_incorrect_suggestions_for_referencing_a_cast, r=estebank
in which suggestions to borrow casts or binary expressions are rectified

 resolves #46756

r? @estebank
2017-12-17 01:56:12 +00:00