about summary refs log tree commit diff
path: root/src/test/ui/mir
AgeCommit message (Collapse)AuthorLines
2020-10-20Add test for issue-68841Yuki Okushi-0/+15
2020-10-07add test for should_inline incorrect param_envBastian Kauschke-0/+32
2020-10-07add regression testBastian Kauschke-0/+28
2020-10-07normalize substs during inliningBastian Kauschke-0/+17
2020-10-07Rollup merge of #77568 - lcnr:mir-inline-def-id, r=ecstatic-morseDylan DPC-0/+38
inliner: use caller param_env We used the callee param env instead of the caller param env by accident in #77430, this PR fixes that and caches it in the `Inliner` struct. fixes #77564 r? @ecstatic-morse
2020-10-05inliner: use caller param_envBastian Kauschke-0/+38
2020-10-04Add regression test for SimplifyBranchSame miscompilationTomasz Miąsko-0/+21
2020-10-02Fix test nameCamelid-0/+0
Remove trailing `-`.
2020-10-01Disable the SimplifyArmIdentity mir-optWesley Wiser-0/+35
The optimization still has some bugs that need to be worked out such as #77359. We can try re-enabling this again after the known issues are resolved.
2020-09-29Auto merge of #76754 - varkor:diagnostic-cleanup-ii, r=ecstatic-morsebors-2/+2
Clean up diagnostics for arithmetic operation errors Plus a small tweak to a range pattern error message.
2020-09-27[mir-opt] Introduce a new flag to enable experimental/unsound mir optsWesley Wiser-1/+1
2020-09-26Make invalid integer operation messages consistentvarkor-2/+2
2020-09-25Auto merge of #73453 - erikdesjardins:tuplayout, r=eddybbors-0/+27
Ignore ZST offsets when deciding whether to use Scalar/ScalarPair layout This is important because Scalar/ScalarPair layout previously would not be used if any ZST had nonzero offset. For example, before this change, only `((), u128)` would be laid out like `u128`, not `(u128, ())`. Fixes #63244
2020-09-20Add a regression test for copy propagation miscompilationTomasz Miąsko-0/+30
2020-09-17[mir-opt] Disable the `ConsideredEqual` logic in SimplifyBranchSame optWesley Wiser-0/+19
The logic is currently broken and we need to disable it to fix a beta regression (see #76803)
2020-09-14Auto merge of #76123 - tmiasko:inline-args-storage, r=wesleywiserbors-0/+16
inliner: Emit storage markers for introduced arg temporaries When introducing argument temporaries during inlining, emit storage marker statements just before the assignment and in the beginning of the return block. This ensures that such temporaries will not be considered live across yield points after inlining inside a generator. Fixes #71793.
2020-09-03inliner: Emit storage markers for introduced arg temporariesTomasz Miąsko-0/+16
When introducing argument temporaries during inlining, emit storage marker statements just before the assignment and in the beginning of the return block. This ensures that such temporaries will not be considered live across yield points after inlining inside a generator.
2020-09-02Fold length constant in Rvalue::RepeatTomasz Miąsko-0/+29
2020-08-30add tests related to tuple scalar layout with ZST in last fieldErik Desjardins-0/+27
2020-08-12allow escaping bound vars when normalizing `ty::Opaque`Bastian Kauschke-0/+13
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-2/+2
propagation
2020-06-24lints: add `improper_ctypes_definitions`David Wood-0/+3
This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: David Wood <david@davidtw.co>
2020-06-23The const propagator cannot trace references.Oliver Scherer-8/+2
Thus we avoid propagation of a local the moment we encounter references to it.
2020-05-28Add test for #66930Yuki Okushi-0/+11
2020-05-08Skip tests on emscriptenYuki Okushi-0/+11
2020-05-06Move tests from `test/run-fail` to UIYuki Okushi-0/+247
2020-04-28Added new ui tests to show what errors MIR can now find at compile timeFélix Fischer-0/+46
2020-03-13Add test for issue-60390Yuki Okushi-0/+8
2020-03-06fix various typosMatthias Krüger-1/+1
2020-02-03rustc_codegen_ssa: don't treat inlined variables as debuginfo arguments.Eduard-Mihai Burtescu-0/+11
2020-02-02add raw-addr-of variant to mir_raw_fat_ptrRalf Jung-1/+58
2020-01-09Delay bug to prevent ICE in MIR borrowckYuki Okushi-0/+23
2020-01-05Fix ICE involving calling `Instance.ty` during const evaluationAaron Hill-0/+34
Fixes #67639 `Instance.ty` assumes that we are in a fully monomorphic context (e.g. codegen), and can therefore use an empty `ParamEnv` when performing normalization. Howver, the MIR constant evaluator code ends up calling `Instance.ty` as a result of us attemptign to 'speculatively' const-evaluate generic functions during const propagation. As a result, we may end up with projections involving type parameters (e.g. <T as MyTrait>::Bar>) in the type we are trying to normalize. Normalization expects us to have proper predicates in the `ParamEnv` for such projections, and will ICE if we don't. This commit adds a new method `Instance.ty_env`, which takes a `ParamEnv` for use during normalization. The MIR const-evaluator code is changed to use this method, passing in the proper `ParamEnv` for the context at hand.
2020-01-01Ensure that we process projections during MIR inliningAaron Hill-0/+17
Fixes #67710 Previously, we were not calling `super_place`, which resulted in us failing to update any local references that occur in ProjectionElem::Index. This caused the post-inlining MIR to contain a reference to a local ID from the inlined callee, leading to an ICE due to a type mismatch.
2019-12-14Revert "Remove `#![feature(never_type)]` from tests."Niko Matsakis-0/+1
This reverts commit 8f6197f39f7d468dfc5b2bd41dae4769992a2f83.
2019-12-06const-prop: Restrict scalar pair propagationÖmer Sinan Ağacan-0/+13
We now only propagate a scalar pair if the Rvalue is a tuple with two scalars. This for example avoids propagating a (u8, u8) value when Rvalue has type `((), u8, u8)` (see the regression test). While this is a correct thing to do, implementation is tricky and will be done later. Fixes #66971 Fixes #66339 Fixes #67019
2019-11-21Remove `#![feature(never_type)]` from tests.Mazdak Farrokhzad-1/+0
Also remove `never_type` the feature-gate test.
2019-11-13Revert "Auto merge of #65134 - ↵Robin Kruppe-3/+0
davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe" This reverts commit 3f0e16473de5ec010f44290a8c3ea1d90e0ad7a2, reversing changes made to 61a551b4939ec1d5596e585351038b8fbd0124ba.
2019-11-11Evaluate borrow and struct expressions in `into`Matthew Jasper-0/+67
This fixes some ordering problems around assignment expressions.
2019-11-05improper_ctypes: `extern "C"` fnsDavid Wood-0/+3
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-2/+2
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-2/+2
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-2/+2
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-2/+2
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-08-15Group all ui tests and move to abi #62593Kevin Per-22/+0
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-0/+2075