about summary refs log tree commit diff
path: root/src/librustc_mir
AgeCommit message (Collapse)AuthorLines
2020-04-21sccs are computed in dependency orderNiko Matsakis-53/+5
We don't need the `scc_dependency_order` vector, `all_sccs` is already in dependency order.
2020-04-21Rollup merge of #71285 - ljedrz:mir_inline_span_for_optimized_mir, ↵Dylan DPC-7/+5
r=ecstatic-morse MIR: use HirId instead of NodeId to avoid cycles while inlining I wanted to see if I could limit the number of uses of `NodeId` when `HirId` is available and I saw that some of the MIR `Inliner` code could use `Span` instead of `NodeId`, not unlike in https://github.com/rust-lang/rust/pull/71197. ~If I'm understanding the reason for not calling `optimized_mir` in incremental builds here correctly, this change could also allow us to do so.~ This change could affect performance, so if this approach makes sense, a perf run is probably a good idea.
2020-04-20const prop: don't special case return placeJonas Schievink-9/+5
2020-04-20Use copy_op_transmuteJonas Schievink-1/+1
2020-04-20Remove unnecessary blockJonas Schievink-6/+4
2020-04-20Fix codegen and mir-opt testsJonas Schievink-1/+0
Mostly renamed allocations, but I'm not sure about the const prop tests
2020-04-20Update const propJonas Schievink-5/+5
2020-04-20Dump return_place upon returningJonas Schievink-0/+1
2020-04-20Fix pop_stack_frame logicJonas Schievink-22/+7
2020-04-20Remove null placesJonas Schievink-16/+0
2020-04-20Treat RETURN_PLACE as a normal LocalJonas Schievink-65/+40
Copy its value to the `return_place` upon leaving a call frame
2020-04-20Remove some `Vec` allocations in an effort to improve perfEsteban Küber-2/+1
2020-04-20Remove unused dependenciesShotaro Yamada-1/+0
2020-04-19[ConstProp] Use a `BitSet<Local>` instead of `IndexVec<Local, bool>`Wesley Wiser-5/+4
2020-04-19Note that some terminators should cause an errorDylan MacKenzie-0/+2
2020-04-19Exhaustively match on `TerminatorKind` during const checkingDylan MacKenzie-1/+11
2020-04-19Exhaustively match on `StatementKind` during const checkingDylan MacKenzie-3/+8
2020-04-19Check for `llvm_asm` in a const contextDylan MacKenzie-1/+8
2020-04-19Auto merge of #70598 - vakaras:add-threads-cr3, r=oli-obk,RalfJungbors-70/+172
Make the necessary changes to support concurrency in Miri. This pull request makes the necessary changes to the Rust compiler to allow Miri to support concurrency: 1. Move stack from the interpretation context (`InterpCx`) to machine, so that the machine can switch the stacks when it changes the thread being executed. 2. Add the callbacks that allow the machine to generate fresh allocation ids for each thread local allocation and to translate them back to original allocations when needed. This allows the machine to ensure the property that allocation ids are unique, which allows using a simpler representation of the memory. r? @oli-obk cc @RalfJung
2020-04-19MIR: use span instead of NodeId to determine if optimized_mir should be runljedrz-7/+5
2020-04-19Dogfood more or_patterns in the compilerJosh Stone-160/+187
2020-04-19Rollup merge of #71303 - tshepang:master, r=Mark-SimulacrumDylan DPC-5/+5
remove build warnings Code blocks that are not annotated are assumed to be Rust
2020-04-19Rollup merge of #71276 - RalfJung:miri-unleash-box, r=ecstatic-morseDylan DPC-3/+1
miri-unleashed: test that we detect heap allocations This removes the second-to-last use of `IS_SUPPORTED_IN_MIRI = false`. r? @ecstatic-morse @oli-obk
2020-04-18remove build warningsTshepang Lekhonkhobe-5/+5
Code blocks that are not annotated are assumed to be Rust
2020-04-18Detect mistyped associated consts in `Instance::resolve`.Eduard-Mihai Burtescu-10/+21
2020-04-18Miri: mplace_access_checked: offer option to force different alignment on placeRalf Jung-2/+4
2020-04-18miri-unleashed: test that we detect heap allocationsRalf Jung-2/+0
2020-04-18check_consts: make ops module privateRalf Jung-1/+1
2020-04-17Rollup merge of #71238 - RalfJung:miri-typo, r=oli-obkDylan DPC-1/+1
Miri: fix typo r? @oli-obk at least I think this should be "without", right?
2020-04-17Rollup merge of #71254 - JOE1994:add_comment, r=jonas-schievinkDylan DPC-0/+1
Minor fix and addition to doc comments 1. Fixed doc comment of struct 'rustc_middle::mir::Location' Currently, the general explanation of the struct appears at the field explanation section. I moved and changed the doc comments slightly, so that the general explanation would appear in the proper location in docs. 2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn' Unlike other counterparts, brief explanation for this function was missing, so I added one. Thank you for reviewing this PR :)
2020-04-17Rollup merge of #69642 - ecstatic-morse:issue-69615, r=oli-obkDylan DPC-17/+10
Use query to determine whether function needs const checking Resolves #69615. The HIR const-checker was checking the `constness` of a function's `fn_sig` to determine whether a function needed const-checking. Now that const trait impls are a thing, this is no longer enough. All code should use the `is_const_fn_raw` query instead, which takes the constness of the impl block into account. r? @oli-obk
2020-04-17Minor fix and addition to doc commentsJOE1994-0/+1
1. Fixed doc comment of struct 'rustc_middle::mir::Location' Currently, the general explanation of the struct appears at the field explanation section. I moved and changed the doc comments slightly, so that the general explanation would appear in the proper location in docs. 2. Added doc comment explaining 'rustc_mir::util::pretty::write_mir_fn' Unlike other counterparts, brief explanation for this function was missing, so I added one. Thank you for reviewing this PR :)
2020-04-17Auto merge of #71049 - eddyb:const-err, r=oli-obkbors-25/+23
Add `ConstKind::Error` and convert `ErrorHandled::Reported` to it. By replicating the `ty::Error` approach to encoding "an error has occurred", all of the mechanisms that skip redundant/downstream errors are engaged and help out (see the reduction in test output). This PR also adds `ErrorHandled::Linted` for the lint case because using `ErrorHandled::Reported` *without* having emitted an error that is *guaranteed* to stop compilation, is incorrect now. r? @oli-obk cc @rust-lang/wg-const-eval @varkor @yodaldevoid
2020-04-17Miri: fix typoRalf Jung-1/+1
2020-04-17Auto merge of #70629 - anyska:fields-variant, r=oli-obkbors-5/+10
rustc_target::abi: add Primitive variant to FieldsShape. Originally suggested by @eddyb.
2020-04-17Rollup merge of #71164 - RalfJung:uninit-not-undef, r=oli-obkDylan DPC-6/+11
reword Miri validity errors: undefined -> uninitialized I don't think we say "undefined value" or anything like that anywhere in the docs or so, but we do use the term "uninitialized memory", so I think we should do the same here. Longer-term, I think we should also internally rename "undef" to "uninit". r? @oli-obk
2020-04-16Rollup merge of #71197 - ljedrz:unsafe_unused, r=ecstatic-morseDylan DPC-7/+13
Don't use the HirId to NodeId map in MIR Another step towards not having to build a `HirId` to `NodeId` map other than for doc and RLS purposes. We are currently sorting `unsafe` blocks by `NodeId` in `check_unsafety`; change it to sorting by `Span` instead; this passes the tests, but better ideas are welcome. In addition, simplify the split between the used and unused `unsafe` blocks for readability and less sorting. cc https://github.com/rust-lang/rust/issues/50928
2020-04-16Auto merge of #71201 - Dylan-DPC:rollup-23202uf, r=Dylan-DPCbors-46/+34
Rollup of 5 pull requests Successful merges: - #70566 (Don't bail out before linting in generic contexts.) - #71141 (Provide better compiler output when using `?` on `Option` in fn returning `Result` and vice-versa) - #71149 (remove an impossible branch from check_consts) - #71179 (fix more clippy warnings) - #71191 (Clean up E0520 explanation) Failed merges: r? @ghost
2020-04-16comment on the sorting of unused unsafe blocksljedrz-0/+2
2020-04-16Move stack access methods in the Machine implementations out of the enforce_ ↵Vytautas Astrauskas-28/+28
method group.
2020-04-16mir/interpret: only use `ErrorHandled::Reported` for `ErrorReported`.Eduard-Mihai Burtescu-26/+23
2020-04-16ty: add `ty::ConstKind::Error` to replace `tcx.consts.err`.Eduard-Mihai Burtescu-0/+1
2020-04-16rustc_target::abi: add Primitive variant to FieldsShape.Ana-Maria Mihalache-5/+10
2020-04-16Move the explanation why adjust_global_const is called for all constants.Vytautas Astrauskas-3/+5
2020-04-16Rename Machine::eval_maybe_thread_local_static_const to adjust_global_const ↵Vytautas Astrauskas-2/+7
and add an additional comment.
2020-04-16Rollup merge of #71179 - matthiaskrgr:cl6ppy, r=Dylan-DPCDylan DPC-25/+24
fix more clippy warnings
2020-04-16Rollup merge of #71149 - RalfJung:check-const-call, r=eddybDylan DPC-16/+5
remove an impossible branch from check_consts All function calleess are either `FnPtr` or `FnDef`, so we can remove the alternative from check_consts and just make it ICE instead.
2020-04-16Rollup merge of #70566 - jumbatm:exceeding-bitshifts-constprop, r=RalfJungDylan DPC-5/+5
Don't bail out before linting in generic contexts. Fixes #69021. cc #70017 r? @RalfJung
2020-04-16sort unused unsafe blocks by Span instead of NodeIdljedrz-1/+1
2020-04-16Respond to code review feedbackWesley Wiser-1/+9
- Remove reads of indirect `Place`s - Add comments explaining what the algorithm does