Commit Graph

86452 Commits

Author SHA1 Message Date
Pietro Albini
6c2513c0d3
Rollup merge of #56045 - qnighy:additional-sizedness, r=cramertj
Check arg/ret sizedness at ExprKind::Path

This PR solves three problems:

- #50940: ICE on casting unsized tuple struct constructors
- Unsized tuple struct constructors were callable in presence of `unsized_locals`.
- https://github.com/rust-lang/rust/issues/48055#issuecomment-437178966: we cannot relax `Sized` bounds on stable functions because of fn ptr casting

These are caused by lack of `Sized`ness checks for arguments/retvals at **reference sites of `FnDef` items** (not call sites of the functions). Therefore we can basically add more `Sized` obligations on typeck. However, adding `Sized` obligations arbitrarily breaks type inference; to prevent that I added a new method `require_type_is_sized_deferred` which doesn't interfere usual type inference.
2018-11-25 17:04:58 +01:00
Pietro Albini
1aa3ffaf99
Rollup merge of #56024 - oli-obk:const_fn_collect_inner, r=michaelwoerister
Don't auto-inline const functions

fixes #53451
2018-11-25 17:04:57 +01:00
bors
e9bca7a993 Auto merge of #55906 - nnethercote:rm-OpenSnapshot-CommittedSnapshot, r=nikomatsakis
Clean up and streamline snapshot data structures

These commits clean up the snapshot structures a bit, so they are more consistent with each other and with the `ena` crate.

They also remove the `OpenSnapshot` and `CommittedSnapshot` entries in the undo log, just like I did for the `ena` crate in https://github.com/rust-lang-nursery/ena/pull/14. This PR in combination with that `ena` PR reduces instruction counts by up to 6% on benchmarks.

r? @nikomatsakis. Note that this isn't quite ready for landing, because the `ena` dependency in the first commit needs to be updated once https://github.com/rust-lang-nursery/ena/pull/14 lands. But otherwise it should be good.
2018-11-25 12:20:18 +00:00
Nicholas Nethercote
94967ae8c1 Remove OpenSnapshot and CommittedSnapshot markers from RegionConstraintCollector.
They're not strictly necessary, and they result in the `Vec` being
allocated even for the trivial (and common) case where a
`start_snapshot` is immediately followed by a `commit` or `rollback_to`.

The commit also removes a now-unnecessary argument of
`pop_placeholders()`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote
2d68fa07bf Remove OpenSnapshot and CommittedSnapshot markers from SnapshotMap.
They're not strictly necessary, and they result in the `Vec` being
allocated even for the trivial (and common) case where a
`start_snapshot` is immediately followed by a `commit` or `rollback_to`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote
f23c969492 Introduce in_snapshot and assert_open_snapshot methods.
This makes the two snapshot implementations more consistent with each
other and with crate `ena`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote
f5624e41e8 Make commit and rollback_to methods take ownership of the snapshots.
Because they shouldn't be reused. This provides consistency with the
`ena` crate.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote
7fe09a6551 Replace a .truncate(0) call with .clear(). 2018-11-25 17:54:06 +11:00
Nicholas Nethercote
c86bbd4830 Rename UndoLogEntry as UndoLog.
So that it matches `librustc_data_structures/snapshot_map/mod.rs` and
the `ena` crate.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote
9847b5cfcb Remove insert_noop.
Because it's as useless as its name suggests.

This commit also renames `UndoLog::Noop` as `UndoLog::Purged`, because
(a) that's a more descriptive name and (b) it matches the name used in
similar code in `librustc/infer/region_constraints/mod.rs`.
2018-11-25 17:54:06 +11:00
Nicholas Nethercote
1e34dfce6f Update to ena 0.11.0.
This version has some significant speed-ups relating to snapshotting.
2018-11-25 17:54:04 +11:00
bors
abe19a7305 Auto merge of #55921 - scalexm:placeholders, r=nikomatsakis
Add placeholder types

Fixes #48696 (handle universes in canonicalization of type inference vars), and fixes #55098.
2018-11-25 06:48:21 +00:00
bors
37961dbd2d Auto merge of #55959 - matthewjasper:remove-end-region, r=nikomatsakis
Cleanup from lexical MIR borrowck removal

Lexical MIR borrowck was removed months ago now, and `EndRegion`s are no longer used for MIRI verification.

* Remove `rustc::mir::StatementKind::EndRegion` and the `-Zemit_end_regions` flag
* Use `RegionVid` instead of `Region` in BorrowSet
* Rewrite drop generation to create fewer goto terminators.

r? @nikomatsakis
2018-11-25 03:00:30 +00:00
bors
2dd94c133e Auto merge of #55915 - oli-obk:miri_engine_refactoring, r=RalfJung
Miri engine refactoring

next small step of https://github.com/rust-lang/rust/pull/55293

r? @RalfJung
2018-11-25 00:00:17 +00:00
scalexm
b8a30f04cd Try to work around #53332 in src/test/run-pass/rustc-rust-log.rs 2018-11-24 23:42:14 +01:00
bors
edaac35d67 Auto merge of #56201 - kennytm:revert-55935, r=alexcrichton
Revert "appveyor: Use VS2017 for all our images"

This reverts commit 008e5dcbd5 (#55935)

We suspect this causes the spurious failure in https://github.com/rust-lang/rust/pull/55906#issuecomment-441365922 and https://github.com/rust-lang/rust/pull/55915#issuecomment-441377543.

r? @alexcrichton
2018-11-24 20:08:57 +00:00
kennytm
91f8e3721c
Revert "appveyor: Use VS2017 for all our images"
This reverts commit 008e5dcbd5.
2018-11-25 00:25:56 +08:00
Oliver Scherer
b853252bcd Rebase fallout 2018-11-24 11:36:32 +01:00
Oliver Scherer
360f9888bc update miri submodule 2018-11-24 11:36:32 +01:00
Oliver Scherer
3220c0ce1a Explain why vtable generation needs no alignment checks 2018-11-24 11:36:32 +01:00
Oliver Scherer
22872196f5 Factor out mplace offsetting into its own method 2018-11-24 11:36:32 +01:00
Oliver Scherer
972d798881 Document Allocation 2018-11-24 11:36:32 +01:00
Oliver Scherer
cb8fa33572 tidy 2018-11-24 11:36:32 +01:00
Oliver Scherer
a5ef2d1b54 Array and slice projections need to update the place alignment 2018-11-24 11:36:32 +01:00
Ralf Jung
10102d1f0a comment nit
Co-Authored-By: oli-obk <github35764891676564198441@oli-obk.de>
2018-11-24 11:36:32 +01:00
Oliver Scherer
9b8e82ad24 Use correct alignment checks for scalars and zsts, too 2018-11-24 11:36:32 +01:00
Oliver Scherer
927c5aab47 Use correct alignment for fat pointer extra part 2018-11-24 11:36:32 +01:00
Oliver Scherer
9d57adf2ba Explain {read,write}_scalar failure to cope with zsts 2018-11-24 11:36:32 +01:00
Oliver Scherer
8b04b09869 Move alignment checks out of Allocation 2018-11-24 11:36:32 +01:00
Oliver Scherer
1c08ced995 Explain early abort legality 2018-11-24 11:36:32 +01:00
Oliver Scherer
d3139b9c41 Rebase fallout 2018-11-24 11:36:32 +01:00
Oliver Scherer
b820cc79a9 Clean up array/slice of primitive validation 2018-11-24 11:36:32 +01:00
Oliver Scherer
65b702c6b1 Update miri submodule 2018-11-24 11:36:32 +01:00
Oliver Scherer
87bd5d13d8 Remove stderr file, because the test passes now 2018-11-24 11:36:32 +01:00
Oliver Scherer
ef332959dc Reintroduce zst-slice reading read_bytes method on Memory 2018-11-24 11:36:32 +01:00
Oliver Scherer
ebf03363f2 Properly test for int pointers in fat pointers to str slices of zero chars 2018-11-24 11:36:31 +01:00
Oliver Scherer
cc2f46e55a Reorder methods in allocation.rs 2018-11-24 11:36:31 +01:00
Oliver Scherer
20dee47a66 Add regression test for integral pointers in zst str slice fat pointers 2018-11-24 11:36:31 +01:00
Oliver Scherer
df1ed0c2a6 Make a method that doesn't need Self a free function instead 2018-11-24 11:36:31 +01:00
Oliver Scherer
a835555474 Make zst accesses in allocations take the regular path.
Speeding up zst accesses should be done on a higher level.
2018-11-24 11:36:31 +01:00
Oliver Scherer
3a0e8254b0 Remove unnecessary Result (function always returned Ok) 2018-11-24 11:36:31 +01:00
Oliver Scherer
07e7804110 Adjust rustc_mir::interpret to changes in Allocation/Memory methods 2018-11-24 11:36:31 +01:00
Oliver Scherer
9ecde5712e Move some byte and scalar accessors from Memory to Allocation 2018-11-24 11:36:31 +01:00
Oliver Scherer
ad11856431 Fiddle a HasDataLayout through the allocation methods 2018-11-24 11:36:31 +01:00
Oliver Scherer
04210f3e16 Access self instead of alloc 2018-11-24 11:36:31 +01:00
Oliver Scherer
c392fbbbf1 Adjust generics to Allocation parameters 2018-11-24 11:36:31 +01:00
Oliver Scherer
7c9d786e50 Move alignment and bounds check from Memory to Allocation 2018-11-24 11:36:31 +01:00
Oliver Scherer
d98c46ce57 Move undef mask methods from Memory to Allocation 2018-11-24 11:36:31 +01:00
Oliver Scherer
eb30ce8acb Move relocation methods from Memory to Allocation 2018-11-24 11:36:31 +01:00
Oliver Scherer
d40a7713d3 Preliminary code adjustment to let the compiler complain about missing methods 2018-11-24 11:36:31 +01:00