about summary refs log tree commit diff
path: root/tests/ui/impl-trait/in-trait
AgeCommit message (Collapse)AuthorLines
2025-08-22On E0277, point at type that doesn't implement boundEsteban Küber-1/+1
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-4/+4
2025-07-13compute all rpitit of a traitbohan-1/+35
2025-07-10Make `Diag::multipart_suggestions` always verboseEsteban Küber-3/+6
2025-07-07consider nested cases for duplicate RPITITbohan-1/+138
2025-07-06distinguish the duplicate item of rpititbohan-0/+83
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-47/+92
2025-06-27Report infer ty errors during hir ty loweringOli Scherer-1/+1
This centralizes the placeholder type error reporting in one location, but it also exposes the granularity at which we convert things from hir to ty more. E.g. previously infer types in where bounds were errored together with the function signature, but now they are independent.
2025-06-22Implement DesugaringKind::FormatLiteralmejrs-5/+2
2025-05-27Use more detailed spans in dyn compat errors within bodiesOli Scherer-4/+4
2025-05-26Deduplicate dyn compatibility violations due to coercionMichael Goulet-20/+1
2025-05-23Do not try to confirm non-dyn compatible methodMichael Goulet-37/+1
2025-05-20Do not call name() on rpitit assoc_itemSantiago Pastorino-0/+34
2025-05-05Auto merge of #140453 - Zoxc:next-disambiguator, r=oli-obkbors-12/+12
Remove global `next_disambiguator` state and handle it with a `DisambiguatorState` type This removes `Definitions.next_disambiguator` as it doesn't guarantee deterministic def paths when `create_def` is called in parallel. Instead a new `DisambiguatorState` type is passed as a mutable reference to `create_def` to help create unique def paths. `create_def` calls with distinct `DisambiguatorState` instances must ensure that that the def paths are unique without its help. Anon associated types did rely on this global state for uniqueness and are changed to use (method they're defined in + their position in the method return type) as the `DefPathData` to ensure uniqueness. This also means that the method they're defined in appears in error messages, which is nicer. `DefPathData::NestedStatic` is added to use for nested data inside statics instead of reusing `DefPathData::AnonConst` to avoid conflicts with those. cc `@oli-obk`
2025-04-29Remove global `next_disambiguator` state and handle it with a ↵John Kåre Alsaker-12/+12
`DisambiguatorState` type
2025-04-28Do not compute type_of for impl item if impl where clauses are unsatisfiedMichael Goulet-0/+32
2025-04-25Don't use item name to look up associated item from trait itemMichael Goulet-0/+49
2025-04-20Don't compute name of associated item if it's an RPITITMichael Goulet-0/+62
2025-04-15Don't compute name of associated item if it's an RPITITMichael Goulet-0/+21
2025-04-14add RPITIT tests: method compat auto trait leakagelcnr-0/+224
2025-04-14do not leak auto traits in item boundslcnr-0/+3
2025-04-11Rollup merge of #139662 - nnethercote:tweak-DefPathData, r=compiler-errorsJacob Pratt-6/+6
Tweak `DefPathData` Some improvements in and around `DefPathData`, following on from #137977. r? `@spastorino`
2025-04-11Change how anonymous associated types are printed.Nicholas Nethercote-6/+6
Give them their own symbol `anon_assoc`, as is done for all the other anonymous `DefPathData` variants.
2025-04-11Improve `AssocItem::descr`.Nicholas Nethercote-4/+4
The commit adds "associated" to the description of associated types and associated consts, to match the description of associated functions. This increases error message precision and consistency with `AssocKind::fmt`. The commit also notes an imperfection in `AssocKind::fmt`; fixing this imperfection is possible but beyond the scope of this PR.
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-8/+8
2025-03-23Stabilize precise_capturing_in_traitsMichael Goulet-8/+6
2025-03-03Do not recover missing lifetime with random in-scope lifetimeMichael Goulet-37/+7
2025-02-21More sophisticated span trimmingMichael Goulet-12/+8
2025-02-17Deeply normalize associated type bounds before proving themMichael Goulet-0/+6
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-37/+58
``` 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-04Fix rustc_hidden_type_of_opaques for RPITITs with no default bodyMichael Goulet-0/+23
2025-02-01Rollup merge of #135900 - compiler-errors:derive-wf, r=lcnrMatthias Krüger-0/+5
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-31Auto merge of #136350 - matthiaskrgr:rollup-6eqfyvh, r=matthiaskrgrbors-8/+8
Rollup of 9 pull requests Successful merges: - #134531 ([rustdoc] Add `--extract-doctests` command-line flag) - #135860 (Compiler: Finalize dyn compatibility renaming) - #135992 (Improve documentation when adding a new target) - #136194 (Support clobber_abi in BPF inline assembly) - #136325 (Delay a bug when indexing unsized slices) - #136326 (Replace our `LLVMRustDIBuilderRef` with LLVM-C's `LLVMDIBuilderRef`) - #136330 (Remove unnecessary hooks) - #136336 (Overhaul `rustc_middle::util`) - #136341 (Remove myself from vacation) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-31Manually walk into WF obligations in BestObligation proof tree visitorMichael Goulet-0/+5
2025-01-30Filter out RPITITs when suggesting unconstrained assoc type on too many genericsMichael Goulet-0/+31
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-8/+8
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-48/+56
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-04Rollup merge of #135055 - compiler-errors:rpitit-infer-in-stricter-impl, ↵Matthias Krüger-38/+61
r=estebank Report impl method has stricter requirements even when RPITIT inference gets in the way See the comment I added in the code. Fixes #122506.
2025-01-03Do not project when there are unconstrained impl paramsMichael Goulet-10/+2
2025-01-03Report impl has stricter requirements even when RPITIT inference gets in the wayMichael Goulet-38/+61
2024-12-14Rollup merge of #134181 - estebank:trim-render, r=oli-obkMatthias Krüger-9/+0
Tweak multispan rendering to reduce output length Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments. We do that check not only on the first 4 lines of the multispan, but now also on the previous to last line as well.
2024-12-12Tweak multispan renderingEsteban Küber-9/+0
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-10Don't check RPITITs that are Self:Sized for PointerLikeMichael Goulet-0/+13
2024-12-07Mention type parameter in more cases and don't suggest ~const bound already ↵Esteban Küber-5/+5
there
2024-12-07Use trait name instead of full constraint in suggestion messageEsteban Küber-5/+5
``` 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-5/+5
2024-12-02Assert that obligations are empty before deeply normalizingMichael Goulet-2/+2
2024-11-30Move refinement check out of compare_impl_itemMichael Goulet-0/+26
2024-11-24Actually use placeholder regions for trait method late bound regions in ↵Michael Goulet-14/+67
collect_return_position_impl_trait_in_trait_tys
2024-11-22Stabilize the 2024 editionEric Huss-1/+1