| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
This reverts commit 03770f0e2b60c02db8fcf52fed5fb36aac70cedc, reversing
changes made to 01ef4b21dc5251b58bd9c6fd6face2ae95d56da1.
|
|
Use non-ascribed type as field's type in mir
Fixes https://github.com/rust-lang/rust/issues/96514
r? `@lcnr`
|
|
|
|
|
|
|
|
|
|
|
|
Use it in all UI tests that are about the semantics and not the syntax
of type ascription.
|
|
|
|
|
|
|
|
Fix unwind drop glue for if-then scopes
cc `@est31`
Fix #102317
Fix #99852
This PR fixes the drop glue for unwinding from a panic originated in a drop while breaking out for the else block in an `if-then` scope.
MIR validation does not fail for the synchronous versions of the test program, because `StorageDead` statements are skipped over in the unwinding process. It is only becoming a problem when it is inside a generator where `StorageDead` must be kept around.
|
|
|
|
|
|
Suggest Default::default() when binding isn't initialized
Fixes #102087
|
|
|
|
Note the type when unable to drop values in compile time
|
|
|
|
This test case actually requires std::process.
|
|
Adding needs-unwind arg to applicable compiler ui tests
Adding `needs-unwind` arg to applicable compiler ui tests
|
|
|
|
|
|
Try normalizing types without RevealAll in ParamEnv in MIR validation
Before, the MIR validator used RevealAll in its ParamEnv for type
checking. This could cause false negatives in some cases due to
RevealAll ParamEnvs not always use all predicates as expected here.
Since some MIR passes like inlining use RevealAll as well, keep using
it in the MIR validator too, but when it fails usign RevealAll, also
try the check without it, to stop false negatives.
Fixes #99866
cc ````````@compiler-errors```````` who nicely helped me on zulip
|
|
This reverts commit 326646074940222d602f3683d0559088690830f4.
This is the revert against master, the beta revert was already done in #100538.
|
|
Before, the MIR validator used RevealAll in its ParamEnv for type
checking. This could cause false negatives in some cases due to
RevealAll ParamEnvs not always use all predicates as expected here.
Since some MIR passes like inlining use RevealAll as well, keep using
it in the MIR validator too, but when it fails usign RevealAll, also
try the check without it, to stop false negatives.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Consider lifetimes when comparing types for equality in MIR validator
Closes #95978 .
|
|
|
|
|
|
Fixes #95616
|
|
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
|