about summary refs log tree commit diff
path: root/tests/ui/mir/validate
AgeCommit message (Collapse)AuthorLines
2025-07-20Ban projecting into SIMD types [MCP838]Scott McMurray-0/+18
2025-07-19Give a message with a span on validation errorScott McMurray-2/+2
2025-05-04compiletest: Support matching on non-json lines in compiler outputVadim Petrochenkov-1/+3
and migrate most of remaining `error-pattern`s to it.
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-7/+7
2024-12-07Mention type parameter in more cases and don't suggest ~const bound already ↵Esteban Küber-1/+1
there
2024-12-07Use trait name instead of full constraint in suggestion messageEsteban Küber-1/+1
``` help: consider restricting type parameter `T` with traits `Copy` and `Trait` | LL | fn duplicate_custom<T: Copy + Trait>(t: S<T>) -> (S<T>, S<T>) { | ++++++++++++++ ``` ``` help: consider restricting type parameter `V` with trait `Copy` | LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V { | +++++++++++++++++++ ```
2024-12-07reword trait bound suggestion message to include the boundsEsteban Küber-1/+1
2024-12-07Don't suggest restricting bound with unstable traits on stableEsteban Küber-1/+1
On nightly, we mention the trait is unstable ``` error[E0277]: the trait bound `T: Unstable` is not satisfied --> $DIR/unstable-trait-suggestion.rs:13:9 | LL | foo(t) | --- ^ the trait `Unstable` is not implemented for `T` | | | required by a bound introduced by this call | note: required by a bound in `foo` --> $DIR/unstable-trait-suggestion.rs:9:11 | LL | fn foo<T: Unstable>(_: T) {} | ^^^^^^^^ required by this bound in `foo` help: consider restricting type parameter `T` but it is an `unstable` trait | LL | pub fn demo<T: Unstable>(t: T) { | ++++++++++ ``` On stable, we don't suggest the trait at all ``` error[E0277]: the trait bound `T: Unstable` is not satisfied --> $DIR/unstable-trait-suggestion.rs:13:9 | LL | foo(t) | --- ^ the trait `Unstable` is not implemented for `T` | | | required by a bound introduced by this call | note: required by a bound in `foo` --> $DIR/unstable-trait-suggestion.rs:9:11 | LL | fn foo<T: Unstable>(_: T) {} | ^^^^^^^^ required by this bound in `foo` ```
2024-12-02Allow fn pointers comparisons lint in UI testsUrgau-0/+2
2024-11-23remove remaining references to `Reveal`lcnr-2/+2
2024-09-25Validate unsize coercion in MIR validationMichael Goulet-0/+53
2024-06-03Reformat `mir!` macro invocations to use braces.Nicholas Nethercote-9/+8
The `mir!` macro has multiple parts: - An optional return type annotation. - A sequence of zero or more local declarations. - A mandatory starting anonymous basic block, which is brace-delimited. - A sequence of zero of more additional named basic blocks. Some `mir!` invocations use braces with a "block" style, like so: ``` mir! { let _unit: (); { let non_copy = S(42); let ptr = std::ptr::addr_of_mut!(non_copy); // Inside `callee`, the first argument and `*ptr` are basically // aliasing places! Call(_unit = callee(Move(*ptr), ptr), ReturnTo(after_call), UnwindContinue()) } after_call = { Return() } } ``` Some invocations use parens with a "block" style, like so: ``` mir!( let x: [i32; 2]; let one: i32; { x = [42, 43]; one = 1; x = [one, 2]; RET = Move(x); Return() } ) ``` And some invocations uses parens with a "tighter" style, like so: ``` mir!({ SetDiscriminant(*b, 0); Return() }) ``` This last style is generally used for cases where just the mandatory starting basic block is present. Its braces are placed next to the parens. This commit changes all `mir!` invocations to use braces with a "block" style. Why? - Consistency is good. - The contents of the invocation is a block of code, so it's odd to use parens. They are more normally used for function-like macros. - Most importantly, the next commit will enable rustfmt for `tests/mir-opt/`. rustfmt is more aggressive about formatting macros that use parens than macros that use braces. Without this commit's changes, rustfmt would break a couple of `mir!` macro invocations that use braces within `tests/mir-opt` by inserting an extraneous comma. E.g.: ``` mir!(type RET = (i32, bool);, { // extraneous comma after ';' RET.0 = 1; RET.1 = true; Return() }) ``` Switching those `mir!` invocations to use braces avoids that problem, resulting in this, which is nicer to read as well as being valid syntax: ``` mir! { type RET = (i32, bool); { RET.0 = 1; RET.1 = true; Return() } } ```
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-23/+23
2024-02-09Don't ice in validation when error body is createdMichael Goulet-0/+18
2023-12-26custom mir: make it clear what the return block isRalf Jung-2/+2
2023-12-21Add pass to identify undefined or erroneous behaviourTomasz Miąsko-44/+0
2023-11-22Validate there are no critical call edges in optimized MIRTomasz Miąsko-0/+31
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-07-29Change default panic handler message format.Mara Bos-0/+1
2023-04-20Give more descriptive names to queries.Camille GILLOT-1/+1
2023-04-20Remove WithOptconstParam.Camille GILLOT-1/+1
2023-04-09Fix transmute intrinsic mir validation ICEJakob Degen-0/+17
2023-02-25MIR-Validate StorageLive.Camille GILLOT-0/+43
2023-01-11Move /src/test to /testsAlbert Larsan-0/+62