about summary refs log tree commit diff
path: root/tests/ui/wf
AgeCommit message (Collapse)AuthorLines
2025-09-28reword noteEsteban Küber-2/+2
2025-09-28Point at lifetime requirement origin in more casesEsteban Küber-0/+12
2025-08-22On E0277, point at type that doesn't implement boundEsteban Küber-2/+12
When encountering an unmet trait bound, point at local type that doesn't implement the trait: ``` error[E0277]: the trait bound `Bar<T>: Foo` is not satisfied --> $DIR/issue-64855.rs:9:19 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound | help: the trait `Foo` is not implemented for `Bar<T>` --> $DIR/issue-64855.rs:9:1 | LL | pub struct Bar<T>(<Self as Foo>::Type) where Self: ; | ^^^^^^^^^^^^^^^^^ ```
2025-08-19bless tests with new lint messagesKarol Zwolak-1/+1
2025-08-08update test expectations for boring locals + dropckoutlives interactionsRémy Rakic-5/+48
The suboptimal error only appears with NLLs due to liveness differences where polonius cannot have as many boring locals. Sometimes this causes NLLs to emit a duplicate error as well.
2025-08-06Fortify generic param default checksLeón Orell Valerian Liehr-2/+2
2025-07-25Check statics' type in type_of.Camille GILLOT-40/+1
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-2/+2
2025-06-30Avoid looking at HIR for trait and impl itemsOli Scherer-10/+10
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-3/+3
2025-06-13Merge unboxed trait object error suggestion into regular dyn incompat errorOli Scherer-18/+7
2025-06-05Add missing `dyn` keywords to tests that do not test for themLukas Wirth-73/+27
2025-05-27Use more detailed spans in dyn compat errors within bodiesOli Scherer-2/+2
2025-05-05Deeply normalize in the new solver in WFMichael Goulet-25/+26
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-2/+3
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-5/+5
2025-04-06update/bless testsBennet Bleßmann-6/+6
2025-03-03Don't typeck during WF, instead check outside of WF in check_crateMichael Goulet-10/+10
2025-02-28Introduce `feature(generic_const_parameter_types)`Boxy-3/+24
2025-02-24Remove dyn_compatible_for_dispatchMichael Goulet-233/+0
2025-02-17Update tests for dropck normalization errorsMatthew Jasper-2/+14
Takes crash tests from #135039, #103899, #91985 and #105299 and turns them into ui tests
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-2/+3
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-04Rename and Move some UI tests to more suitable subdirsDuskyElf-0/+18
2025-02-01Rollup merge of #135900 - compiler-errors:derive-wf, r=lcnrMatthias Krüger-0/+21
Manually walk into WF obligations in `BestObligation` proof tree visitor When we encounter a `WellFormed` obligation in the `BestObligation` proof tree visitor, ignore the proof tree and call `wf::unnormalized_obligations` to derive well-formed obligations with the correct cause codes. This is to avoid having to replicate the somewhat delicate logic that `wf.rs` does to set up its obligation causes... Don't see a better way to do this. vibes?? r? lcnr
2025-01-31Manually walk into WF obligations in BestObligation proof tree visitorMichael Goulet-0/+21
2025-01-31Rollup merge of #135860 - fmease:compiler-mv-obj-save-dyn-compat-ii, r=jieyouxuMatthias Krüger-11/+11
Compiler: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #130826. Part of #130852. ~~Blocking it on #133372.~~ (merged) r? ghost
2025-01-30update commentlcnr-4/+3
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-11/+11
2025-01-22Rollup merge of #135866 - BoxyUwU:dont_pick_fnptr_nested_goals, r=lcnrMatthias Krüger-45/+105
Don't pick `T: FnPtr` nested goals as the leaf goal in diagnostics for new solver r? `@lcnr` See `tests/ui/traits/next-solver/diagnostics/dont-pick-fnptr-bound-as-leaf.rs` for a minimized example of what code this affects the diagnostics off. The output of running nightly `-Znext-solver` on that test is the following: ``` error[E0277]: the trait bound `Foo: Trait` is not satisfied --> src/lib.rs:14:20 | 14 | requires_trait(Foo); | -------------- ^^^ the trait `FnPtr` is not implemented for `Foo` | | | required by a bound introduced by this call | note: required for `Foo` to implement `Trait` --> src/lib.rs:7:16 | 7 | impl<T: FnPtr> Trait for T {} | ----- ^^^^^ ^ | | | unsatisfied trait bound introduced here note: required by a bound in `requires_trait` --> src/lib.rs:11:22 | 11 | fn requires_trait<T: Trait>(_: T) {} | ^^^^^ required by this bound in `requires_trait` ``` Part of rust-lang/trait-system-refactor-initiative#148
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-53/+68
This CL makes a number of small changes to dyn compatibility errors: - "object safety" has been renamed to "dyn-compatibility" throughout - "Convert to enum" suggestions are no longer generated when there exists a type-generic impl of the trait or an impl for `dyn OtherTrait` - Several error messages are reorganized for user readability Additionally, the dyn compatibility error creation code has been split out into functions. cc #132713 cc #133267
2025-01-22Don't pick `T: FnPtr` nested goalsBoxy-45/+105
2025-01-17remove unnecessary assertion for reference erroryukang-0/+13
2024-12-07Use trait name instead of full constraint in suggestion messageEsteban Küber-17/+17
``` 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-19/+19
2024-12-06Silence follow-up errors from `lit_to_const`Oli Scherer-71/+4
2024-11-23Dont create trait object if it has errors in itMichael Goulet-119/+18
2024-11-21Stop being so bail-y in candidate assemblyMichael Goulet-16/+2
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-9/+9
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
2024-10-27Stop using the whole match expr span for an arm's obligation spanMichael Goulet-9/+5
2024-10-10UI tests: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-22/+22
2024-10-10Rename feature object_safe_for_dispatch to dyn_compatible_for_dispatchLeón Orell Valerian Liehr-3/+3
2024-09-29fix(hir_analysis/wfcheck): don't leak {type error}Barrett Ray-34/+16
avoid `{type error}` being leaked in user-facing messages, particularly when using the `adt_const_params` feature
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-24/+24
2024-09-09Fix ICE caused by missing span in a region errorGurinder Singh-0/+59
2024-08-05Enforce supertrait outlives obligations hold when confirming implMichael Goulet-6/+28
2024-07-18Revert "sort suggestions for object diagnostic"Michael Goulet-2/+2
This reverts commit 540be28f6c2571e7be3ab3936b62635fa0d3caf3.
2024-06-05Bless tests and handle tests/crashesBoxy-133/+47
2024-05-16Report better WF obligation leaf obligations in new solverMichael Goulet-16/+23
2024-05-07Auto merge of #124219 - gurry:122989-ice-unexpected-anon-const, ↵bors-0/+200
r=compiler-errors Do not ICE on `AnonConst`s in `diagnostic_hir_wf_check` Fixes #122989 Below is the snippet from #122989 that ICEs: ```rust trait Traitor<const N: N<2> = 1, const N: N<2> = N> { fn N(&N) -> N<2> { M } } trait N<const N: Traitor<2> = 12> {} ``` The `AnonConst` that triggers the ICE is the `2` in the param `const N: N<2> = 1`. The currently existing code in `diagnostic_hir_wf_check` deals only with `AnonConst`s that are default values of some param, but the `2` is not a default value. It is just an `AnonConst` HIR node inside a `TraitRef` HIR node corresponding to `N<2>`. Therefore the existing code cannot handle it and this PR ensures that it does.
2024-04-25Add testMichael Goulet-0/+31