summary refs log tree commit diff
path: root/src/test/ui/mir
AgeCommit message (Collapse)AuthorLines
2022-08-29regression tests for problems that are exposed by mir-inlining policy that ↵Felix S. Klock II-0/+42
we are reverting for 1.64-beta.
2022-08-15Revert let_chains stabilizationNilstrieb-1/+13
This reverts commit 326646074940222d602f3683d0559088690830f4. It was discovered that they are not implemented correctly, which does not make them ready for stabilization.
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-5/+6
2022-07-16Stabilize `let_chains`Caio-13/+1
2022-07-07Tweak wording and spansEsteban Küber-2/+2
2022-07-07On partial uninit error point at where we need initEsteban Küber-3/+6
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-07-06fix projectionelem validationDrMeepster-2/+2
2022-06-28Migrate some rustc_borrowck diagnostics to SessionDiagnosticMichael Goulet-3/+3
2022-06-25[rustc_parse] Forbid lets in certain placesCaio-2/+9
2022-06-15remove box derefs from codgenDrMeepster-8/+10
2022-04-16Rollup merge of #96004 - JakobDegen:fix-validator-ice, r=petrochenkovDylan DPC-0/+10
Consider lifetimes when comparing types for equality in MIR validator Closes #95978 .
2022-04-14Update issue-92893.stderrouz-a-0/+27
2022-04-13Consider lifetimes when comparing types for equality in MIR validatorJakob Degen-0/+10
2022-04-04diagnostics: use correct span for const genericsMichael Howell-2/+2
Fixes #95616
2022-03-23add test for treating ExprKind::ConstParam as tempb-naber-0/+42
2022-03-16Extend the irrefutable_let_patterns lint to let chainsest31-0/+1
Only look for complete suffixes or prefixes of irrefutable let patterns, so that an irrefutable let pattern in a chain surrounded by refutable ones is not linted, as it is an useful pattern.
2022-03-13Fix definition of Box in ssa-analysis-regression-50041.rsbjorn3-2/+2
The Box in liballoc always has a field for the allocator. It is quite hard to support both the old and new definition of Box in cg_clif so this change uses the new definition in this test too.
2022-01-18Formally implement let chainsCaio-0/+93
2021-12-22Delay remaining `span_bug`s in drop elaborationTomasz Miąsko-0/+82
This follows changes from #67967 and converts remaining `span_bug`s into delayed bugs, since for const items drop elaboration might be executed on a MIR which failed borrowck.
2021-12-18Rollup merge of #91975 - cjgillot:noinline-generator, r=jackh726Matthias Krüger-1/+1
Move generator check earlier in inlining. Inlining into generator may create references to other generators. For instance, inlining `Pin::<&mut from_generator::GenFuture<[generator1]>>::new_unchecked` into `generator2`. This cross reference can then create cycles when computing inlining for `generator1`. In order to avoid this kind of surprises, we forbid all inlining into generators, and rely on LLVM to do the right thing. The existing `remove-zst-query-cycle` already ICEs in inline-mir mode, so we use it as test. Split from #91743.
2021-12-15Move generator check earlier in inlining.Camille GILLOT-1/+1
2021-12-14Return an error when `eval_rvalue_with_identities` failsTomasz Miąsko-0/+12
Previously some code paths would fail to evaluate the rvalue, while incorrectly indicating success with `Ok`. As a result the previous value of lhs could have been incorrectly const propagated.
2021-12-13use try_normalize_erasing_regions in RevealAllVisitorb-naber-0/+21
2021-12-09Add needs-unwind to tests that depend on panickingDavid Koloski-0/+4
This directive isn't automatically set by compiletest or x.py, but can be turned on manually for targets that require it.
2021-11-24Remove `-Z force-overflow-checks`Noah Lev-1/+1
It was replaced several years ago by the stable option `-C overflow-checks`. The goal was to delete the `-Z` flag once users had migrated [1]. Now that it's been several years, it makes sense to delete the old flag. See also the discussion on Zulip [2]. [1]: https://github.com/rust-lang/rust/issues/33134#issuecomment-280484097 [2]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/overflow.20checks/near/262497224
2021-11-18Move some tests to more reasonable directoriesCaio-0/+30
2021-11-06Move some tests to more reasonable directoriesCaio-0/+14
2021-10-03Fix unsound optimization with explicit variant discriminantsFabian Wolff-0/+18
2021-09-15Disable RemoveZsts in generators to avoid query cyclesTomasz Miąsko-0/+16
Querying layout of a generator requires its optimized MIR. Thus computing layout during MIR optimization of a generator might create a query cycle. Disable RemoveZsts in generators to avoid the issue (similar approach is used in ConstProp transform already).
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-116/+0
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-1/+1
:sparkles:
2021-08-16Use note to point at bound introducing requirementEsteban Küber-3/+5
2021-08-11Modify structured suggestion outputEsteban Küber-1/+1
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-08-04Remove trailing whitespace from error messagesFabian Wolff-3/+3
2021-07-27Remove min_tait and full_tait stderr dangling filesSantiago Pastorino-16/+0
2021-07-27Make all tests use type_alias_impl_trait feature instead of minSantiago Pastorino-3/+9
2021-07-27Use type_alias_impl_trait instead of min in compiler and libSantiago Pastorino-13/+3
2021-07-18Remove impl_trait_in_bindings feature flagSantiago Pastorino-39/+15
2021-06-09Handle C-variadic arguments properly when reporting region errorsFabian Wolff-2/+2
2021-05-28const eval errors: display the current item instance if there are generics ↵Rémy Rakic-2/+2
involved
2021-04-01Add a test that triggers the out-of-bounds ICE.Midas Lambrichts-0/+31
Add a test that has the right input to trigger an out-of-bounds error when in MIR the local_decls and the normalized_input_tys don't match in amount.
2021-03-18Rollup merge of #83080 - tmiasko:inline-coverage, r=wesleywiserDylan DPC-23/+0
Make source-based code coverage compatible with MIR inlining When codegenning code coverage use the instance that coverage data was originally generated for, to ensure basic level of compatibility with MIR inlining. Fixes #83061
2021-03-17Rollup merge of #83092 - petrochenkov:qspan, r=estebankYuki Okushi-1/+1
More precise spans for HIR paths `Ty::assoc_item` is lowered to `<Ty>::assoc_item` in HIR, but `Ty` got span from the whole path. This PR fixes that, and adjusts some diagnostic code that relied on `Ty` having the whole path span. This is a pre-requisite for https://github.com/rust-lang/rust/pull/82868 (we cannot report suggestions like `Tr::assoc` -> `<dyn Tr>::assoc` with the current imprecise spans). r? ````@estebank````
2021-03-15Remove inline-instrument-coverage-fail.rs test caseTomasz Miąsko-23/+0
2021-03-15More precise spans for HIR pathsVadim Petrochenkov-1/+1
2021-03-15🍼 for tidyOli Scherer-2/+3
2021-03-15Only allow tait defining uses in function and method return positionOli Scherer-11/+18
2021-03-15Add a test showing how `impl_trait_in_bindings` is a breaking changeOli Scherer-2/+58
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-1/+1
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2021-03-05bless mir-inlining warning messageSantiago Pastorino-1/+1