summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2018-09-12Merge branch 'master' into kenta7777#53719kenta7777-17/+20
2018-09-10propagate user-ascribes types down onto resulting bindingsNiko Matsakis-0/+3
But only in very simple cases.
2018-09-10fixup: rename `UserAssertTy` to `AscribeUserType`Niko Matsakis-1/+1
This is some rebase pain.
2018-09-10add the `AscribeUserType` statement kindNiko Matsakis-16/+16
Make it have the semantics of subtype.
2018-09-10renamed mk_nil to mk_unitkenta7777-2/+2
2018-09-08Auto merge of #53903 - GabrielMajeri:opt-miri-array-slice, r=oli-obkbors-1/+1
Optimize miri checking of integer array/slices This pull request implements the optimization described in #53845 (the `E-easy` part of that issue, not the refactoring). Instead of checking every element of an integral array, we can check the whole memory range at once. r? @RalfJung
2018-09-08Auto merge of #53705 - ms2300:tmp, r=oli-obkbors-1/+1
#53576 Renaming TyAnon -> TyOpaque Fixes #53576
2018-09-08Optimize miri checking of integer array/slicesGabriel Majeri-1/+1
Instead of checking every element, we can check the whole memory range at once.
2018-09-07make field always private, add `From` implsNiko Matsakis-5/+2
2018-09-06Fixing tests from anon -> opaquems2300-1/+1
2018-09-03Auto merge of #53697 - Cyres:const-fn-int-ops, r=oli-obkbors-1/+10
Add more const int ops r? @oli-obk Tracking Issue: #53718 list of `const fn`s in this PR: - `feature = const_int_rotate` - `rotate_left` - `rotate_right` - `feature = const_int_wrapping` - `wrapping_add` - `wrapping_sub` - `wrapping_mul` - `wrapping_shl` - `wrapping_shr` - `feature = const_int_overflowing` - `overflowing_add` - `overflowing_sub` - `overflowing_mul` - `overflowing_shl` - `overflowing_shr` - `feature = const_int_sign` - `is_positive` - `is_negative` - `feature = const_int_conversion` - `reverse_bits` - `to_le_bytes` - `to_ne_bytes` - `from_be_bytes` - `from_le_bytes` - `from_ne_bytes` - `reverse_bits`
2018-09-01rebaseTim-1/+10
2018-09-01Auto merge of #53604 - oli-obk:min_const_fn, r=Centril,varkorbors-10/+402
Implement the `min_const_fn` feature gate cc @RalfJung @eddyb r? @Centril implements the feature gate for #53555 I added a hack so the `const_fn` feature gate also enables the `min_const_fn` feature gate. This ensures that nightly users of `const_fn` don't have to touch their code at all. The `min_const_fn` checks are run first, and if they succeeded, the `const_fn` checks are run additionally to ensure we didn't miss anything.
2018-08-31Auto merge of #53699 - oli-obk:promotion_stability_hole, r=nikomatsakisbors-3/+1
Fix promotion stability hole in old borrowck r? @nikomatsakis I screwed up the promotion stability checks. Big time. They were basically nonexistant. We had tests for it. I also screwed up said tests. This is in stable already :( Basically stability checks of promotion only worked if you tried to use a const fn defined in the same crate. cc @eddyb
2018-08-31Get rid of token passingOliver Schneider-55/+35
2018-08-31Implement the `min_const_fn` feature gateOliver Schneider-10/+422
2018-08-31Auto merge of #53832 - pietroalbini:rollup, r=pietroalbinibors-12/+17
Rollup of 20 pull requests Successful merges: - #51760 (Add another PartialEq example) - #53113 (Add example for Cow) - #53129 (remove `let x = baz` which was obscuring the real error) - #53389 (document effect of join on memory ordering) - #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.) - #53476 (Add partialeq implementation for TryFromIntError type) - #53513 (Force-inline `shallow_resolve` at its hottest call site.) - #53655 (set applicability) - #53702 (Fix stabilisation version for macro_vis_matcher.) - #53727 (Do not suggest dereferencing in macro) - #53732 (save-analysis: Differentiate foreign functions and statics.) - #53740 (add llvm-readobj to llvm-tools-preview) - #53743 (fix a typo: taget_env -> target_env) - #53747 (Rustdoc fixes) - #53753 (expand keep-stage --help text) - #53756 (Fix typo in comment) - #53768 (move file-extension based .gitignore down to src/) - #53785 (Fix a comment in src/libcore/slice/mod.rs) - #53786 (Replace usages of 'bad_style' with 'nonstandard_style'.) - #53806 (Fix UI issues on Implementations on Foreign types) Failed merges: r? @ghost
2018-08-31Auto merge of #53779 - RalfJung:miri-refactor, r=oli-obkbors-12/+20
Miri refactor: Final round Tying up some loose ends that I noticed in the previous PRs -- and finally getting argument passing into a shape where @eddyb says it is "okay", which is a big improvement over the previous verdict that I cannot quote in public. ;) Also move a bunch of useful helpers to construct `Scalar` from miri to here. Cc @eddyb r? @oli-obk
2018-08-30Rollup merge of #53472 - eddyb:fx-pls, r=pnkfelixPietro Albini-12/+17
Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc. Most of the compiler uses the `Fx` hasher but some places ended up with the default one.
2018-08-30Made std::intrinsics::transmute() const fn.thedarkula-0/+12
2018-08-29make ptr_op finally reponsible for all ops involving pointers; make ValTy ↵Ralf Jung-11/+17
constructor private Also remove public OpTy constructors, but a pub(crate) constructor remains
2018-08-29re-do argument passing one more time to finally be saneRalf Jung-1/+3
2018-08-29Auto merge of #53671 - RalfJung:miri-refactor, r=oli-obkbors-5/+18
Miri engine cleanup * Unify the two maps in memory to store the allocation and its kind together. * Share the handling of statics between CTFE and miri: The miri engine always uses "lazy" `AllocType::Static` when encountering a static. Acessing that static invokes CTFE (no matter the machine). The machine only has any influence when writing to a static, which CTFE outright rejects (but miri makes a copy-on-write). * Add an `AllocId` to by-ref consts so miri can use them as operands without making copies. * Move responsibilities around for the `eval_fn_call` machine hook: The hook just has to find the MIR (or entirely take care of everything); pushing the new stack frame is taken care of by the miri engine. * Expose the intrinsics and lang items implemented by CTFE so miri does not have to reimplement them. * Allow Machine to hook into foreign statics (used by miri to get rid of some other hacks). * Clean up function calling. * Switch const sanity check to work on operands, not mplaces. * Move const_eval out of rustc_mir::interpret, to make sure that it does not access private implementation details. In particular, we can finally make `eval_operand` take `&self`. :-) Should be merged after https://github.com/rust-lang/rust/pull/53609, across which I will rebase.
2018-08-28fix const_prop detecting unary neg underflowsRalf Jung-1/+15
2018-08-28address nitsRalf Jung-1/+1
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-12/+17
2018-08-28Auto merge of #53314 - nikomatsakis:nll-invert-liveness, r=pnkfelixbors-5/+1
NLL: experiment with inverting liveness I got inspired to see what would happen here. Fixes #52460 r? @pnkfelix
2018-08-27Rename hir::map::NodeKind to hir::Nodevarkor-5/+5
2018-08-27Remove path prefixes from NodeKindvarkor-1/+2
2018-08-27Rename hir::map::Node to hir::map::NodeKindvarkor-4/+4
2018-08-27kill dead code from `util/liveness`Niko Matsakis-5/+1
2018-08-27switch validation to use operand, not mplaceRalf Jung-3/+2
this means we can get rid of the public allocate_op, and make OpTy only constructible in librustc_mir
2018-08-27Auto merge of #53656 - nnethercote:HybridIdxSet-tweaks, r=nikomatsakisbors-2/+2
`HybridIdxSet` tweaks A couple of tweaks to `HybridIdxSet`. r? @nikomatsakis
2018-08-25Properly prevent the promotion of unstable const fnsOliver Schneider-3/+1
2018-08-24support user-given types in adtsNiko Matsakis-2/+2
2018-08-24add a `user_ty` annotation to `Constant`Niko Matsakis-1/+4
2018-08-24Introduce `UnionIntoIdxSet` and `SubtractFromIdxSet` traits.Nicholas Nethercote-2/+2
They let `union()`, `union_sparse()` and `union_hybrid()` be merged. Likewise for subtract()`, `subtract_sparse()` and `subtract_hybrid()`.
2018-08-23Auto merge of #53520 - nnethercote:merge-IdxSet-IdxSetBuf, r=nikomatsakisbors-16/+16
Merge `IdxSet` and `IdxSetBuf` Because it simplifies things. @r? nikomatsakis
2018-08-22Auto merge of #52011 - ↵bors-3/+25
oli-obk:dont_you_hate_it_too_when_everything_panics_constantly, r=eddyb Allow panicking with string literal messages inside constants r? @eddyb cc https://github.com/rust-lang/rust/issues/51999 we can't implement things like `panic!("foo: {}", x)` right now because we can't call trait methods (most notably `Display::fmt`) inside constants. Also most of these impls probably have loops and conditions, so it's messy anyway. But hey `panic!("foo")` works at least. cc @japaric got any test ideas for `#![no_std]`?
2018-08-22Allow panicking with string literal messages inside constantsOliver Schneider-3/+25
2018-08-22Remove Ty prefix from Ty{Bool|Char|Int|Uint|Float|Str}varkor-2/+2
2018-08-22Remove Ty prefix from ↵varkor-21/+21
Ty{Adt|Array|Slice|RawPtr|Ref|FnDef|FnPtr|Dynamic|Closure|Generator|GeneratorWitness|Never|Tuple|Projection|Anon|Infer|Error}
2018-08-22Rename ty::TyVariants to ty::TyKindvarkor-5/+5
2018-08-22Rename ty::Slice to ty::Listvarkor-2/+2
2018-08-22miri/CTFE refactorRalf Jung-47/+51
* Value gets renamed to Operand, so that now interpret::{Place, Operand} are the "dynamic" versions of mir::{Place, Operand}. * Operand and Place share the data for their "stuff is in memory"-base in a new type, MemPlace. This also makes it possible to give some more precise types in other areas. Both Operand and MemPlace have methods available to project into fields (and other kinds of projections) without causing further allocations. * The type for "a Scalar or a ScalarPair" is called Value, and again used to give some more precise types. * All of these have versions with an attached layout, so that we can more often drag the layout along instead of recomputing it. This lets us get rid of `PlaceExtra::Downcast`. MPlaceTy and PlaceTy can only be constructed in place.rs, making sure the layout is handled properly. (The same should eventually be done for ValTy and OpTy.) * All the high-level functions to write typed memory take a Place, and live in place.rs. All the high-level typed functions to read typed memory take an Operand, and live in operands.rs.
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-10/+10
Fix typos found by codespell.
2018-08-20Remove IdxSet typedef and Rename {,Hybrid}IdxSetBuf as {,Hybrid}IdxSet.Nicholas Nethercote-16/+16
Now that the `Buf` vs. non-`Buf` distinction has been removed, it makes sense to drop the `Buf` suffix and use the shorter names everywhere.
2018-08-19mv codemap() source_map()Donato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-10/+10