about summary refs log tree commit diff
path: root/src/librustc_mir/transform
AgeCommit message (Collapse)AuthorLines
2017-08-28rustc_mir: conservatively deny non-noop drops in constant contexts.Eduard-Mihai Burtescu-5/+55
2017-08-28Merge branch 'master' of https://github.com/rust-lang/rust into genJohn Kåre Alsaker-1/+6
2017-08-25rustc: Add a FIXME for `try_get` in MIR inliningAlex Crichton-1/+6
It sounds like this is being handled elsewhere, so for now just preserve the existing behavior of ignoring th error.
2017-08-25Add some comments and fix a typoJohn Kåre Alsaker-3/+53
2017-08-25Add some suggested comments around dropsAlex Crichton-2/+6
2017-08-25Add a `self_arg` convenienceAlex Crichton-6/+10
2017-08-25Reorder slightly in `visit_basic_block_data`Alex Crichton-12/+12
2017-08-25Fix indentationAlex Crichton-27/+27
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-1277/+2
2017-08-21Merge remote-tracking branch 'origin/master' into genAlex Crichton-20/+3
2017-08-21Moved support code for `rustc_mir::borrow_check` query out of `mod transform`.Felix S. Klock II-1244/+0
2017-08-21Remove the `rustc_mir::transform` entry point for mir-borrowck.Felix S. Klock II-24/+1
2017-08-21Expose mir-borrowck via a query.Felix S. Klock II-2/+3
(A followup commit removes the mir::transform based entry point.)
2017-08-19rustc: Remove some dead codeVadim Petrochenkov-20/+3
2017-08-17Merge remote-tracking branch 'origin/master' into genAlex Crichton-0/+8
2017-08-17Auto merge of #43902 - michaelwoerister:fix-mir-passes-promoted, r=arielb1bors-0/+8
Run MIR passes on promoted temporaries again. This seems to have been broken some time in the past (maybe here: https://github.com/rust-lang/rust/commit/9c154a67bf5c6841c39afdb90388cc3ba36dc70c#diff-2f8e8805126c84b2be3f0967ffa0af28L162). r? @arielb1
2017-08-16Fix merge conflictsAlex Crichton-0/+9
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-2/+1280
2017-08-16Fix merge conflictAlex Crichton-1/+1
2017-08-16Merge remote-tracking branch 'origin/master' into genAlex Crichton-48/+48
2017-08-16Address review comment: `StatementKind::StorageDead` has an effect (running ↵Felix S. Klock II-2/+10
dtors) relevant to borrowck.
2017-08-16Cleanup: Every `BitDenotation` is a `DataflowOperator`, so build that in.Felix S. Klock II-1/+0
Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
2017-08-16MIR based borrow check (opt-in).Felix S. Klock II-0/+1271
One can either use `-Z borrowck-mir` or add the `#[rustc_mir_borrowck]` attribute to opt into MIR based borrow checking. Note that regardless of whether one opts in or not, AST-based borrow check will still run as well. The errors emitted from AST-based borrow check will include a "(Ast)" suffix in their error message, while the errors emitted from MIR-based borrow check will include a "(Mir)" suffix. post-rebase: removed check for intra-statement mutual conflict; replaced with assertion checking that at most one borrow is generated per statement. post-rebase: removed dead code: `IdxSet::pairs` and supporting stuff.
2017-08-16Refactor `trait BitDenotation` to take `Location` instead of ↵Felix S. Klock II-2/+2
`BasicBlock`/`usize` argument pairs.
2017-08-16Run MIR passes on promoted temporaries again.Michael Woerister-0/+8
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-48/+48
Like #43008 (f668999), but _much more aggressive_.
2017-08-14Fix merge conflicts with `gen` branchAlex Crichton-1/+2
2017-08-14Merge remote-tracking branch 'origin/master' into genAlex Crichton-2/+20
2017-08-13Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkovGuillaume Gomez-1/+1
Fix some typos Follow up of #43794 If refined my script a little bit and found some more.
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-12Check #[thread_local] statics correctly in the compiler.Eduard-Mihai Burtescu-1/+19
2017-08-12Fix errorsJohn Kåre Alsaker-1/+1
2017-08-12Strip landing pads in the state transformationJohn Kåre Alsaker-0/+5
2017-08-11Merge remote-tracking branch 'origin/master' into genAlex Crichton-48/+156
2017-08-11Auto merge of #43748 - RalfJung:mir-validate2, r=arielb1bors-34/+43
AddValidation: handle Call terminators into blocks that have multiple incoming edges The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.
2017-08-11Store generator interior in MIR literalsJohn Kåre Alsaker-2/+2
2017-08-11TypoJohn Kåre Alsaker-1/+1
2017-08-11Some tweaks and commentsJohn Kåre Alsaker-45/+95
2017-08-11Remove code related to the dropping of generator argumentsJohn Kåre Alsaker-45/+5
2017-08-10Merge remote-tracking branch 'origin/master' into genAlex Crichton-3/+2
2017-08-10Auto merge of #43559 - Nashenas88:nll-region-renumberer, r=arielb1bors-14/+113
Non-lexical lifetimes region renumberer Regenerates region variables for all regions in a cloned MIR in the nll mir pass. This is part of the work for #43234.
2017-08-10Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1bors-1/+1
Fixed mutable vars being marked used when they weren't #### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue. Fixes #43526, Fixes #30280, Fixes #25049 ### Issue Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings ``` fn do_thing<T>(mut arg : &mut T) { ... // don't touch arg - just deref it to access the T } ``` ### Fix Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables. #### Why not on things other than local variables? * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted. * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.
2017-08-09Initial pass review commentsAlex Crichton-87/+22
2017-08-09run AddCallGuards for *all* call edges before running AddValidationRalf Jung-34/+43
2017-08-09Merge remote-tracking branch 'origin/master' into genAlex Crichton-10/+434
2017-08-08make `for_all_relevant_impls` O(1) againAriel Ben-Yehuda-2/+1
A change in #41911 had made `for_all_relevant_impls` do a linear scan over all impls, instead of using an HashMap. Use an HashMap again to avoid quadratic blowup when there is a large number of structs with impls. I think this fixes #43141 completely, but I want better measurements in order to be sure. As a perf patch, please don't roll this up.
2017-08-04Keep map hidden and instead move it out after visitor is finishedPaul Faria-1/+6
2017-08-04Auto merge of #43403 - RalfJung:mir-validate, r=nikomatsakisbors-8/+432
Add MIR Validate statement This adds statements to MIR that express when types are to be validated (following [Types as Contracts](https://internals.rust-lang.org/t/types-as-contracts/5562)). Obviously nothing is stabilized, and in fact a `-Z` flag has to be passed for behavior to even change at all. This is meant to make experimentation with Types as Contracts in miri possible. The design is definitely not final. Cc @nikomatsakis @aturon
2017-08-03Store map of region variable ids to lookups in nll visitor and remove ↵Paul Faria-26/+45
reference to mir
2017-08-01also release-validate return value before a callRalf Jung-8/+13