about summary refs log tree commit diff
path: root/tests/ui/mir
AgeCommit message (Collapse)AuthorLines
2023-12-11Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwcobors-0/+2
Add lint against ambiguous wide pointer comparisons This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang. ## `ambiguous_wide_pointer_comparisons` *warn-by-default* The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands. ### Example ```rust let ab = (A, B); let a = &ab.0 as *const dyn T; let b = &ab.1 as *const dyn T; let _ = a == b; ``` ### Explanation The comparison includes metadata which may not be expected. ------- This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one. ~~One thing: is the current naming right? `invalid` seems a bit too much.~~ Fixes https://github.com/rust-lang/rust/issues/117717
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-2/+2
2023-12-06Adjust tests for newly added ambiguous_wide_pointer_comparisons lintUrgau-0/+2
2023-11-25Auto merge of #118075 - tmiasko:validate-critical-call-edges, r=cjgillotbors-0/+31
Validate there are no critical call edges in optimized MIR
2023-11-24Show number in error message even for one errorNilstrieb-7/+7
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-22Validate there are no critical call edges in optimized MIRTomasz Miąsko-0/+31
2023-11-15Auto merge of #117359 - tmiasko:call-def, r=cjgillotbors-0/+30
Fix def-use check for call terminators Fixes #117331.
2023-11-14Rollup merge of #117686 - compiler-errors:gen-body, r=wesleywiserMatthias Krüger-0/+25
Build pre-coroutine-transform coroutine body on error I was accidentally building the post-transform coroutine body, rather than the pre-transform coroutine body. There's no pinning expected here yet, and the return type isn't yet transformed into `CoroutineState`. Fixes #117670
2023-11-14Fix def-use check for call terminatorsTomasz Miąsko-0/+30
2023-11-14Custom MIR: Support cleanup blocksTomasz Miąsko-0/+55
Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-07Build pre-coroutine-transform coroutine bodyMichael Goulet-0/+25
2023-11-04Check alignment of pointers only when read/written throughBen Kimock-6/+87
2023-10-27Lint overlapping ranges as a separate passNadrieril-0/+1
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-09-13Address review commentsMatthew Jasper-0/+2
- Add doc comment to new type - Restore "only supported directly in conditions of `if` and `while` expressions" note - Rename variant with clearer name
2023-09-11Move let expression checking to parsingMatthew Jasper-22/+2
There was an incomplete version of the check in parsing and a second version in AST validation. This meant that some, but not all, invalid uses were allowed inside macros/disabled cfgs. It also means that later passes have a hard time knowing when the let expression is in a valid location, sometimes causing ICEs. - Add a field to ExprKind::Let in AST/HIR to mark whether it's in a valid location. - Suppress later errors and MIR construction for invalid let expressions.
2023-08-27Fix inlining with -Zalways-encode-mirTomasz Miąsko-0/+19
Only inline functions that are considered eligible for inlining by the reachability pass. This constraint was previously indirectly enforced by only exporting MIR of eligible functions, but that approach doesn't work with -Zalways-encode-mir enabled.
2023-08-17Add test.Camille GILLOT-0/+57
2023-07-29Change default panic handler message format.Mara Bos-0/+1
2023-06-17Auto merge of #100036 - DrMeepster:box_free_free_box, r=oli-obkbors-7/+4
Remove `box_free` lang item This PR removes the `box_free` lang item, replacing it with `Box`'s `Drop` impl. Box dropping is still slightly magic because the contained value is still dropped by the compiler.
2023-06-16remove box_free and replace with drop implDrMeepster-7/+4
2023-06-16Disable alignment checks on i686-pc-windows-msvcBen Kimock-0/+22
2023-06-12Adjust UI tests for `unit_bindings`许杰友 Jieyou Xu (Joe)-3/+3
- Either explicitly annotate `let x: () = expr;` where `x` has unit type, or remove the unit binding to leave only `expr;` instead. - Fix disjoint-capture-in-same-closure test
2023-06-04Show note for type ascription interpreted as a constant pattern, not a new ↵许杰友 Jieyou Xu (Joe)-0/+40
variable Given the code ```rust pub fn main() { const y: i32 = 4; let y: i32 = 3; } ``` `y` in the let binding is actually interpreted as a constant pattern and is not a new variable, causing confusing diagnostics about refutable patterns in local binding. This commit extends the note for type ascription as a constant pattern to `AscribeUserType` patterns as well.
2023-06-01Implement custom diagnostic for ConstParamTyMichael Goulet-4/+6
2023-05-27Add a test for misaligned pointer derefs inside addr_of!Ben Kimock-0/+15
2023-04-20Give more descriptive names to queries.Camille GILLOT-1/+1
2023-04-20Remove WithOptconstParam.Camille GILLOT-1/+1
2023-04-13Rollup merge of #110283 - saethlin:check-panics-before-alignment, r=bjorn3Matthias Krüger-0/+17
Only emit alignment checks if we have a panic_impl Fixes https://github.com/rust-lang/rust/issues/109996 r? `@bjorn3` because you commented that this situation could impact you as well
2023-04-13Only emit alignment checks if we have a panic_implBen Kimock-0/+17
2023-04-09Fix transmute intrinsic mir validation ICEJakob Degen-0/+17
2023-04-04Move a const-prop-lint specific hack from mir interpret to const-prop-lint ↵Oli Scherer-0/+51
and make it fallible
2023-04-02Auto merge of #109008 - clubby789:drop-elaborate-array, r=davidtwcobors-0/+16
Drop array patterns using subslices Fixes #109004 Drops contiguous subslices of an array when moving elements out with a pattern, which improves perf for large arrays r? `@compiler-errors`
2023-03-30Disable the ui panic test on wasm32-bareBen Kimock-0/+1
2023-03-23A MIR transform that checks pointers are alignedBen Kimock-0/+11
2023-03-17Drop subslices of arraysclubby789-0/+16
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-10/+0
2023-03-05Add test.Camille GILLOT-0/+15
2023-02-25MIR-Validate StorageLive.Camille GILLOT-0/+43
2023-02-12only require sub type relation on field projection typesb-naber-0/+134
2023-02-05yet another ui testLukas Markeffsky-0/+42
2023-02-05ReErased regions are localLukas Markeffsky-0/+20
2023-01-27Fix def-use dominance checkTomasz Miąsko-0/+19
A definition does not dominate a use in the same statement. For example in MIR generated for compound assignment x += a (when overflow checks are disabled).
2023-01-11Move /src/test to /testsAlbert Larsan-0/+4076