about summary refs log tree commit diff
path: root/tests/ui/wf
AgeCommit message (Collapse)AuthorLines
2024-04-22Do not ICE on `AnonConst`s in `diagnostic_hir_wf_check`Gurinder Singh-0/+200
2024-04-09Silence some follow-up errors on trait impls in case the trait has ↵Oli Scherer-33/+2
conflicting or otherwise incoherent impls
2024-04-09Add regression testOli Scherer-0/+63
2024-04-04rebaseBoxy-5/+6
2024-04-04check `FnDef` return type for WFlcnr-0/+117
2024-03-23Change an ICE regression test to use the original reproducerGurinder Singh-10/+197
This gives us more confidence that the ICE was indeed fixed.
2024-03-22Rollup merge of #122370 - gurry:122199-ice-unexpected-node, r=davidtwcoMatthias Krüger-0/+72
Gracefully handle `AnonConst` in `diagnostic_hir_wf_check()` Instead of running the WF check on the `AnonConst` itself we run it on the `ty` of the generic param of which the `AnonConst` is the default value. Fixes #122199
2024-03-20make `type_flags(ReError) & HAS_ERROR`Ali MJ Al-Nasrawy-2/+16
2024-03-19Gracefully handle AnonConst in diagnostic_hir_wf_check()Gurinder Singh-0/+72
when it is the default value of a generic param
2024-03-10Mark some next-solver-behavior tests explicitly with revisionsMichael Goulet-2/+39
2024-03-06Check that return type is WF in typeckGurinder Singh-2/+42
Without it non-WF types could pass typeck and then later fail in MIR/const eval
2024-02-19return ty::Error when equating ty::ErrorMichael Goulet-23/+5
This helps iron out a difference between Sub and Equate
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-8/+8
2024-02-15Remove a suggestion that is redundantMichael Goulet-4/+0
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-8/+21
2024-02-10Auto merge of #120712 - compiler-errors:async-closures-harmonize, r=oli-obkbors-2/+2
Harmonize `AsyncFn` implementations, make async closures conditionally impl `Fn*` traits This PR implements several changes to the built-in and libcore-provided implementations of `Fn*` and `AsyncFn*` to address two problems: 1. async closures do not implement the `Fn*` family traits, leading to breakage: https://crater-reports.s3.amazonaws.com/pr-120361/index.html 2. *references* to async closures do not implement `AsyncFn*`, as a consequence of the existing blanket impls of the shape `AsyncFn for F where F: Fn, F::Output: Future`. In order to fix (1.), we implement `Fn` traits appropriately for async closures. It turns out that async closures can: * always implement `FnOnce`, meaning that they're drop-in compatible with `FnOnce`-bound combinators like `Option::map`. * conditionally implement `Fn`/`FnMut` if they have no captures, which means that existing usages of async closures should *probably* work without breakage (crater checking this: https://github.com/rust-lang/rust/pull/120712#issuecomment-1930587805). In order to fix (2.), we make all of the built-in callables implement `AsyncFn*` via built-in impls, and instead adjust the blanket impls for `AsyncFn*` provided by libcore to match the blanket impls for `Fn*`.
2024-02-08sort suggestions for object diagnosticMichael Goulet-2/+2
2024-02-07improve pretty printing for trait objectsLukas Markeffsky-6/+6
2024-02-01review comment: change wordingEsteban Küber-2/+2
2024-02-01On E0277 be clearer about implicit `Sized` bounds on type params and assoc typesEsteban Küber-5/+5
``` error[E0277]: the size for values of type `[i32]` cannot be known at compilation time --> f100.rs:2:33 | 2 | let _ = std::mem::size_of::<[i32]>(); | ^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `[i32]` note: required by an implicit `Sized` bound in `std::mem::size_of` --> /home/gh-estebank/rust/library/core/src/mem/mod.rs:312:22 | 312 | pub const fn size_of<T>() -> usize { | ^ required by the implicit `Sized` requirement on this bound in `size_of` ``` Fix #120178.
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-7/+7
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-16wf-check type annotations before normalizationAli MJ Al-Nasrawy-7/+30
2024-01-16borrowck: use implied bounds from impl headerAli MJ Al-Nasrawy-53/+63
2024-01-16borrowck: wf-check fn item argsAli MJ Al-Nasrawy-37/+0
2024-01-02Reorder `check_item_type` diagnostics so they occur next to the ↵Oli Scherer-12/+12
corresponding `check_well_formed` diagnostics
2023-12-08temporarily revert "ice on ambguity in mir typeck"Ali MJ Al-Nasrawy-0/+24
Reverts #116530
2023-11-24Show number in error message even for one errorNilstrieb-37/+37
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-29On object safety error, mention new enum as alternativeEsteban Küber-0/+12
When we encounter a `dyn Trait` that isn't object safe, look for its implementors. If there's one, mention using it directly If there are less than 9, mention the possibility of creating a new enum and using that instead. Account for object unsafe `impl Trait on dyn Trait {}`. Make a distinction between public and sealed traits. Fix #80194.
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-9/+76
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-11Suggest `;` after bare `match` expression E0308Esteban Küber-0/+4
Fix #72634.
2023-10-08remove trailing dotsAli MJ Al-Nasrawy-7/+7
2023-10-08always show and explain sub regionAli MJ Al-Nasrawy-3/+21
2023-10-08improve the suggestion of generic_bound_failureAli MJ Al-Nasrawy-3/+5
2023-10-04Reorder fullfillment errors to keep more interesting ones firstEsteban Küber-9/+9
In `report_fullfillment_errors` push back `T: Sized`, `T: WellFormed` and coercion errors to the end of the list. The pre-existing deduplication logic eliminates redundant errors better that way, keeping the resulting output with fewer errors than before, while also having more detail.
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+39
2023-05-12Note base types of coercionMichael Goulet-16/+8
2023-04-22add known-bug test for unsound issue 104005whtahy-0/+37
2023-04-22add known-bug test for unsound issue 100041whtahy-0/+19
2023-04-22add known-bug test for unsound issue 98117whtahy-0/+23
2023-04-13Rollup merge of #110193 - compiler-errors:body-owner-issue, r=WaffleLapkinMatthias Krüger-0/+44
Check for body owner fallibly in error reporting Sometimes the "body id" we use for an obligation cause is not actually a body owner, like when we're doing WF checking on items. Fixes #110157
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-2/+4
2023-04-11Check for body owner falliblyMichael Goulet-0/+44
2023-03-05oops! new unsoundnessAli MJ Al-Nasrawy-10/+10
Bless tests and show an introduced unsoundness related to exits<'a> { forall<'b> { 'a == 'b } }. We now resolve the var ?a in U0 to the placeholder !b in U1.
2023-02-09Introduce `ReError`Esteban Küber-25/+2
CC #69314
2023-01-30Modify primary span label for E0308Esteban Küber-1/+1
The previous output was unintuitive to users.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+2109