about summary refs log tree commit diff
path: root/tests/ui/async-await/in-trait
AgeCommit message (Collapse)AuthorLines
2025-08-26fix: Add col separator before secondary messages with no sourceScott Schafer-0/+1
2025-07-23Add `ignore-backends` annotations in failing GCC backend ui testsGuillaume Gomez-4/+5
2025-05-27Use more detailed spans in dyn compat errors within bodiesOli Scherer-2/+2
2025-04-28Do not compute type_of for impl item if impl where clauses are unsatisfiedMichael Goulet-0/+39
2025-03-08Refactor coroutine layout logic to precompute all sublayoutsMoulins-0/+3
Also properly attaches spans on layouts of non-promoted coroutine locals, which slightly improves the error messages for some coroutine tests.
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-4/+6
``` 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-05Eagerly detect coroutine recursion pre-mono when possibleMichael Goulet-4/+1
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-1/+1
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-5/+6
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
2024-12-05Stabilize noop_wakerEric Holk-7/+4
Co-authored-by: zachs18 <8355914+zachs18@users.noreply.github.com>
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-1/+1
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-24Consider param-env candidates even if they have errorsMichael Goulet-16/+2
2024-10-10UI tests: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-2/+2
2024-09-27Rollup merge of #130826 - fmease:compiler-mv-obj-safe-dyn-compat, ↵Matthias Krüger-1/+1
r=compiler-errors Compiler: Rename "object safe" to "dyn compatible" Completed T-lang FCP: https://github.com/rust-lang/lang-team/issues/286#issuecomment-2338905118. Tracking issue: https://github.com/rust-lang/rust/issues/130852 Excludes `compiler/rustc_codegen_cranelift` (to be filed separately). Includes Stable MIR. Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language). r? ghost
2024-09-27Cleanup some known-bug issuesJack Huey-8/+6
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-1/+1
2024-08-10Differentiate between methods and associated functionsEsteban Küber-2/+2
Accurately refer to assoc fn without receiver as assoc fn instead of methods. Add `AssocItem::descr` method to centralize where we call methods and associated functions.
2024-07-17Remove invalid further restricting for type boundyukang-4/+0
2024-07-06Uplift push_outlives_componentsMichael Goulet-12/+12
2024-06-25RFC 2383: Stabilize `lint_reasons` :tada:xFrednet-2/+0
2024-03-20make `type_flags(ReError) & HAS_ERROR`Ali MJ Al-Nasrawy-16/+24
2024-03-16Rollup merge of #121720 - tmandry:split-refining, r=compiler-errorsLeón Orell Valerian Liehr-0/+4
Split refining_impl_trait lint into _reachable, _internal variants As discussed in https://github.com/rust-lang/rust/issues/119535#issuecomment-1909352040: > We discussed this today in triage and developed a consensus to: > > * Add a separate lint against impls that refine a return type defined with RPITIT even when the trait is not crate public. > * Place that in a lint group along with the analogous crate public lint. > * Create an issue to solicit feedback on these lints (or perhaps two separate ones). > * Have the warnings displayed with each lint reference this issue in a similar manner to how we do that today with the required `Self: '0'` bound on GATs. > * Make a note to review this feedback on 2-3 release cycles. This points users to https://github.com/rust-lang/rust/issues/121718 to leave feedback.
2024-03-14Fill in HIR hash for associated opaque typesVadim Petrochenkov-0/+11
2024-03-11Remove some unnecessary allow(incomplete_features)Michael Goulet-23/+3
2024-03-05Split refining_impl_trait lint into _reachable, _internal variantsTyler Mandry-0/+4
2024-02-22Tweak wording of "implemented trait isn't imported" suggestionEsteban Küber-1/+1
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-80/+80
2024-02-08Rollup merge of #120103 - compiler-errors:concrete-afits, r=oli-obkMatthias Krüger-20/+51
Make it so that async-fn-in-trait is compatible with a concrete future in implementation There's no technical reason why an AFIT like `async fn foo()` cannot be satisfied with an implementation signature like `fn foo() -> Pin<Box<dyn Future<Output = ()> + 'static>>`. We rejected this previously because we were uncertain about how AFITs worked with refinement, but I don't believe this needs to be a restriction any longer. r? oli-obk
2024-02-08Auto merge of #120558 - oli-obk:missing_impl_item_ice, r=estebankbors-18/+3
Stop bailing out from compilation just because there were incoherent traits fixes #120343 but also has a lot of "type annotations needed" fallout. Some are fixed in the second commit.
2024-02-06Don't expect early-bound region to be local in RPITIT well-formednessMichael Goulet-0/+38
2024-02-05Make sure refinement still worksMichael Goulet-3/+53
2024-02-05Make the error message betterMichael Goulet-9/+6
2024-02-05Allow desugaring async fn in trait to compatible, concrete future typesMichael Goulet-31/+15
2024-02-05Avoid emitting trait bound errors of incoherent traitsOli Scherer-18/+3
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-1/+1
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-25Don't fire OPAQUE_HIDDEN_INFERRED_BOUND on sized return of AFITMichael Goulet-0/+18
2024-01-17Remove unnecessary `let`s and borrowing from `Waker::noop()` usage.Kevin Reid-5/+3
`Waker::noop()` now returns a `&'static Waker` reference, so it can be passed directly to `Context` creation with no temporary lifetime issue.
2024-01-08Make cycle error more resilient to where it startsMichael Goulet-11/+10
Also don't recomment recursive_async crate anymore Co-authored-by: lcnr <rust@lcnr.de>
2024-01-08Point out source of recursionMichael Goulet-8/+14
2023-12-14Rollup merge of #118948 - compiler-errors:noop, r=eholkJubilee-44/+31
Use the `Waker::noop` API in tests Avoids the need to duplicate this code over and over again r? eholk
2023-12-14Use the Waker::noop API in testsMichael Goulet-44/+31
2023-12-12Coroutine variant fields can be uninitializedTomasz Miąsko-3/+5
Wrap coroutine variant fields in MaybeUninit to indicate that they might be uninitialized. Otherwise an uninhabited field will make the entire variant uninhabited and introduce undefined behaviour. The analogous issue in the prefix of coroutine layout was addressed by 6fae7f807146e400fa2bbd1c44768d9bcaa57c4c.
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-2/+2
2023-11-24Show number in error message even for one errorNilstrieb-16/+16
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-25Rollup merge of #117133 - compiler-errors:coherence-constrained, r=oli-obkMatthias Krüger-0/+51
Merge `impl_wf_inference` (`check_mod_impl_wf`) check into coherence checking Problem here is that we call `collect_impl_trait_in_trait_types` when checking `check_mod_impl_wf` which is performed before coherence. Due to the `tcx.sess.track_errors`, since we end up reporting an error, we never actually proceed to coherence checking, where we would be emitting a more useful impl overlap error. This change means that we may report more errors in some cases, but can at least proceed far enough to leave a useful message for overlapping traits with RPITITs in them. Fixes #116982 r? types
2023-10-24Merge impl_wf_inference into coherence checkingMichael Goulet-0/+51
2023-10-24Remove incomplete features from RPITIT/AFIT testsMichael Goulet-37/+10
2023-10-18Don't ICE when encountering unresolved regions in fully_resolveMichael Goulet-0/+28
2023-10-14Rollup merge of #116704 - compiler-errors:afit-lint-plus, r=tmandryMatthias Krüger-1/+1
Fix AFIT lint message to mention pitfall Addresses https://github.com/rust-lang/rust/pull/116184#issuecomment-1745194387 by adding a short note. Not sure exactly of the wording -- I don't think this should be a blocker for the stabilization PR since we can iterate on this lint's messaging in the next few weeks in the worst case. r? `@tmandry` cc `@traviscross` `@jonhoo`
2023-10-13Stabilize AFIT and RPITITMichael Goulet-112/+47