about summary refs log tree commit diff
path: root/tests/ui/delegation
AgeCommit message (Collapse)AuthorLines
2025-09-26Ignore more failing ui tests for GCC backendGuillaume Gomez-2/+3
2025-08-22On E0277, point at type that doesn't implement boundEsteban Küber-4/+24
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-07Use `tcx.short_string()` in more diagnosticsEsteban Küber-1/+1
`TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`. We add support for shortening the path of "trait path only". Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem). When we don't actually print out a shortened type we don't need the "use `--verbose`" note. On E0599 show type identity to avoid expanding the receiver's generic parameters. Unify wording on `long_ty_path` everywhere.
2025-07-23Add `ignore-backends` annotations in failing GCC backend ui testsGuillaume Gomez-0/+1
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-8/+8
2025-06-01Rollup merge of #140370 - WaffleLapkin:unqualified, r=jdonszelmannGuillaume Gomez-6/+2
Improve diagnostics for usage of qualified paths within tuple struct exprs/pats For patterns the old diagnostic was just incorrect, but I also added machine applicable suggestions. For context, this special cases errors for `<T as Trait>::Assoc(..)` patterns and expressions (latter is just a call). Tuple struct patterns and expressions both live in the value namespace, so they are not forwarded through associated *types*. r? ``@jdonszelmann`` cc ``@petrochenkov`` in https://github.com/rust-lang/rust/pull/80080#issuecomment-800630582 you were wondering why it doesn't work for types, that's why — tuple patterns are resolved in the value namespace.
2025-04-29Remove global `next_disambiguator` state and handle it with a ↵John Kåre Alsaker-4/+4
`DisambiguatorState` type
2025-04-27bless testsWaffle Lapkin-6/+2
2025-04-17Rollup merge of #138632 - clubby789:stabilize-cfg-boolean-lit, ↵Matthias Krüger-1/+1
r=davidtwco,Urgau,traviscross Stabilize `cfg_boolean_literals` Closes #131204 `@rustbot` labels +T-lang +I-lang-nominated This will end up conflicting with the test in #138293 so whichever doesn't land first will need updating -- # Stabilization Report ## General design ### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized? [RFC 3695](https://github.com/rust-lang/rfcs/pull/3695), none. ### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con. None ### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those? None ## Has a call-for-testing period been conducted? If so, what feedback was received? Yes; only positive feedback was received. ## Implementation quality ### Summarize the major parts of the implementation and provide links into the code (or to PRs) Implemented in [#131034](https://github.com/rust-lang/rust/pull/131034). ### Summarize existing test coverage of this feature - [Basic usage, including `#[cfg()]`, `cfg!()` and `#[cfg_attr()]`](https://github.com/rust-lang/rust/blob/6d71251cf9e40326461f90f8ff9a7024706aea87/tests/ui/cfg/true-false.rs) - [`--cfg=true/false` on the command line being accessible via `r#true/r#false`](https://github.com/rust-lang/rust/blob/6d71251cf9e40326461f90f8ff9a7024706aea87/tests/ui/cfg/raw-true-false.rs) - [Interaction with the unstable `#[doc(cfg(..))]` feature](https://github.com/rust-lang/rust/tree/6d71251/tests/rustdoc-ui/cfg-boolean-literal.rs) - [Denying `--check-cfg=cfg(true/false)`](https://github.com/rust-lang/rust/tree/6d71251/tests/ui/check-cfg/invalid-arguments.rs) - Ensuring `--cfg false` on the command line doesn't change the meaning of `cfg(false)`: `tests/ui/cfg/cmdline-false.rs` - Ensuring both `cfg(true)` and `cfg(false)` on the same item result in it being disabled: `tests/ui/cfg/both-true-false.rs` ### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking? The above mentioned issue; it should not block as it interacts with another unstable feature. ### What FIXMEs are still in the code for that feature and why is it ok to leave them there? None ### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization - `@clubby789` (RFC) - `@Urgau` (Implementation in rustc) ### Which tools need to be adjusted to support this feature. Has this work been done? `rustdoc`'s unstable`#[doc(cfg(..)]` has been updated to respect it. `cargo` has been updated with a forward compatibility lint to enable supporting it in cargo once stabilized. ## Type system and execution rules ### What updates are needed to the reference/specification? (link to PRs when they exist) A few lines to be added to the reference for configuration predicates, specified in the RFC.
2025-04-11Change how anonymous associated types are printed.Nicholas Nethercote-4/+4
Give them their own symbol `anon_assoc`, as is done for all the other anonymous `DefPathData` variants.
2025-04-06update/bless testsBennet Bleßmann-10/+3
2025-04-03Use `cfg(false)` in UI testsclubby789-1/+1
2025-03-13Delegation: allow foreign fns `reuse`Bryanskiy-0/+49
2025-03-12Rollup merge of #138407 - Bryanskiy:delegation-variadic, r=petrochenkovManish Goregaokar-11/+47
Delegation: reject C-variadics The explanation is contained in attached issues. Fixes https://github.com/rust-lang/rust/issues/127443 Fixes https://github.com/rust-lang/rust/issues/127413 r? `@petrochenkov`
2025-03-12Delegation: reject C-variadicsBryanskiy-11/+47
2025-03-12Delegation: one more ICE fix for `MethodCall` generationBryanskiy-0/+34
2025-03-10Delegation: fix ICE with invalid MethodCall generationBryanskiy-0/+19
2025-02-14fallout :skull_emoji:lcnr-9/+9
2025-01-24Reword "crate not found" resolve messageEsteban Küber-6/+8
``` error[E0432]: unresolved import `some_novel_crate` --> file.rs:1:5 | 1 | use some_novel_crate::Type; | ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate` ``` On resolve errors where there might be a missing crate, mention `cargo add foo`: ``` error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope` --> $DIR/conflicting-impl-with-err.rs:4:11 | LL | impl From<nope::Thing> for Error { | ^^^^ use of unresolved module or unlinked crate `nope` | = help: if you wanted to use a crate named `nope`, use `cargo add nope` to add it to your `Cargo.toml` ```
2025-01-07Update tests.Mara Bos-1/+1
2024-11-12Don't trigger never type lint in a delegation testMaybe Lapkin-52/+17
2024-11-03Yeet effects featureMichael Goulet-19/+18
2024-10-28Hack out effects support for old solverMichael Goulet-6/+1
2024-10-24Implement const effect predicate in new solverMichael Goulet-18/+10
2024-10-04Bless ui tests.Camille GILLOT-16/+16
2024-09-07Auto merge of #126161 - Bryanskiy:delegation-generics-4, r=petrochenkovbors-325/+417
Delegation: support generics in associated delegation items This is a continuation of https://github.com/rust-lang/rust/pull/125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
2024-09-05Delegation: support generics in associated delegation itemsBryanskiy-201/+293
2024-09-03Delegation refactoring: add builders for generics inheritanceBryanskiy-30/+30
2024-08-24Rollup merge of #128524 - ↵Trevor Gross-5/+0
chenyukang:yukang-fix-127930-invalid-outer-style-sugg, r=cjgillot Don't suggest turning crate-level attributes into outer style Fixes #127930
2024-08-16Rewrite `get_fn_id_for_return_block`Boxy-0/+147
2024-08-10Differentiate between methods and associated functionsEsteban Küber-4/+4
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-08-04don't suggest turning crate-level attributes into outer styleyukang-5/+0
2024-07-29Delegation: support generics for delegation from free functionsBryanskiy-140/+395
2024-07-16Delegation: support coercion for target expressionBryanskiy-17/+158
2024-06-25Rollup merge of #126947 - Bryanskiy:delegation-lowering-refactoring, ↵Matthias Krüger-4/+4
r=petrochenkov Delegation: ast lowering refactor refactoring changes for https://github.com/rust-lang/rust/pull/126699 r? ```@petrochenkov```
2024-06-25Delegation: ast lowering refactorBryanskiy-4/+4
2024-06-22delegation: Do not crash on qpaths without a traitVadim Petrochenkov-0/+25
2024-06-19Rollup merge of #124135 - petrochenkov:deleglob, r=fmease许杰友 Jieyou Xu (Joe)-0/+416
delegation: Implement glob delegation Support delegating to all trait methods in one go. Overriding globs with explicit definitions is also supported. The implementation is generally based on the design from https://github.com/rust-lang/rfcs/pull/3530#issuecomment-2020869823, but unlike with list delegation in https://github.com/rust-lang/rust/pull/123413 we cannot expand glob delegation eagerly. We have to enqueue it into the queue of unexpanded macros (most other macros are processed this way too), and then a glob delegation waits in that queue until its trait path is resolved, and enough code expands to generate the identifier list produced from the glob. Glob delegation is only allowed in impls, and can only point to traits. Supporting it in other places gives very little practical benefit, but significantly raises the implementation complexity. Part of https://github.com/rust-lang/rust/issues/118212.
2024-06-15Rollup merge of #126497 - petrochenkov:delehyg, r=compiler-errorsMatthias Krüger-2/+53
delegation: Fix hygiene for `self` And fix diagnostics for `self` from a macro. The missing rib caused `self` to be treated as a generic parameter and ignore `macro_rules` hygiene. Addresses this comment https://github.com/rust-lang/rust/pull/124135#discussion_r1637492234.
2024-06-15delegation: Fix hygiene for `self`Vadim Petrochenkov-2/+53
And fix diagnostics for `self` from a macro.
2024-06-14delegation: Implement glob delegationVadim Petrochenkov-2/+418
2024-06-13Point out exactly what obligation will failMichael Goulet-0/+10
2024-06-13Bless a testWaffle Lapkin-15/+40
2024-06-11Rollup merge of #126236 - Bryanskiy:delegation-no-entry-ice-2, r=petrochenkov许杰友 Jieyou Xu (Joe)-0/+26
Delegation: fix ICE on recursive delegation fixes https://github.com/rust-lang/rust/issues/124347 r? `@petrochenkov`
2024-06-10Delegation: fix ICE on recursive delegationBryanskiy-0/+26
2024-06-10Delegation: fix ICE on late diagnosticsBryanskiy-0/+32
2024-05-15delegation: Implement list delegationVadim Petrochenkov-6/+175
```rust reuse prefix::{a, b, c} ```
2024-04-23delegation: Support async, const, extern "ABI" and C-variadic functionsVadim Petrochenkov-60/+138
Also allow `impl Trait` in delegated functions. The delegation item will refer to the original opaque type from the callee, fresh opaque type won't be created.
2024-04-23delegation: Support renamingVadim Petrochenkov-0/+20