about summary refs log tree commit diff
path: root/tests/ui/ufcs
AgeCommit message (Collapse)AuthorLines
2025-08-26fix: Add col separator before secondary messages with no sourceScott Schafer-0/+8
2025-06-01Rollup merge of #140370 - WaffleLapkin:unqualified, r=jdonszelmannGuillaume Gomez-2/+0
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-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-9/+9
2025-04-27bless testsWaffle Lapkin-2/+0
2025-03-05Use final path segment for diagnosticMichael Goulet-2/+2
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-14/+23
``` 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; | ```
2024-12-13Arbitrary self types v2: adjust diagnostic.Adrian Taylor-6/+6
The recently landed PR to adjust arbitrary self types was a bit overenthusiastic, advising folks to use the new Receiver trait even before it's been stabilized. Revert to the older wording of the lint in such cases.
2024-12-11Arbitrary self types v2: use Receiver traitAdrian Taylor-6/+6
In this new version of Arbitrary Self Types, we no longer use the Deref trait exclusively when working out which self types are valid. Instead, we follow a chain of Receiver traits. This enables methods to be called on smart pointer types which fundamentally cannot support Deref (for instance because they are wrappers for pointers that don't follow Rust's aliasing rules). This includes: * Changes to tests appropriately * New tests for: * The basics of the feature * Ensuring lifetime elision works properly * Generic Receivers * A copy of the method subst test enhanced with Receiver This is really the heart of the 'arbitrary self types v2' feature, and is the most critical commit in the current PR. Subsequent commits are focused on: * Detecting "shadowing" problems, where a smart pointer type can hide methods in the pointee. * Diagnostics and cleanup. Naming: in this commit, the "Autoderef" type is modified so that it no longer solely focuses on the "Deref" trait, but can now consider the "Receiver" trait instead. Should it be renamed, to something like "TraitFollower"? This was considered, but rejected, because * even in the Receiver case, it still considers built-in derefs * the name Autoderef is short and snappy.
2024-09-22Don't call const normalize in error reportingMichael Goulet-4/+4
2024-09-07Bless tests due to new method suggestions.Tim (Theemathas) Chirananthavat-1/+1
2024-07-22Revert suggestion verbosity changeEsteban Küber-6/+3
2024-07-22Change suggestion message wordingEsteban Küber-1/+1
2024-07-22Use verbose suggestion for "wrong # of generics"Esteban Küber-3/+6
2024-07-05Use verbose suggestion for changing arg typeEsteban Küber-4/+5
2024-06-21bless testsDeadbeef-13/+13
2024-06-12Spell out other trait diagnosticAlex Macleod-8/+8
2024-05-23Do not suggest unresolvable builder methodsGurinder Singh-1/+1
2024-04-30Replace item names containing an error code with something more meaningfulLeón Orell Valerian Liehr-3/+3
or inline such functions if useless.
2024-04-12Avoid more NonNull-raw-NonNull roundtrips in VecBen Kimock-1/+1
2024-03-27Use `TraitRef::to_string` sorting in favor of `TraitRef::ord`, as the latter ↵Oli Scherer-4/+4
compares `DefId`s which we need to avoid
2024-03-01try_with_capacity for Vec, VecDeque, StringKornel-2/+2
#91913
2024-02-22Fix rebaseEsteban Küber-4/+5
2024-02-20testMichael Goulet-0/+26
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-1/+1
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-3/+23
2024-02-04fix ui testsDeadbeef-13/+13
these ui changes are closer to what was there before const_trait_impl changes.
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-1/+1
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-02Reorder `check_item_type` diagnostics so they occur next to the ↵Oli Scherer-17/+17
corresponding `check_well_formed` diagnostics
2023-12-10remove redundant importssurechen-2/+1
detects redundant imports that can be eliminated. for #117772 : In order to facilitate review and modification, split the checking code and removing redundant imports code into two PR.
2023-12-07recurse into refs when comparing tys for diagnosticsjyn-14/+14
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-7/+25
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-08-26More accurately point at argumentsEsteban Küber-4/+2
2023-06-27Don't sort strings right after we just sorted by typesMichael Goulet-4/+4
2023-04-07Use smart-resolve when checking for trait in RHS of UFCSMichael Goulet-95/+139
2023-04-02Move some UI tests into subdirectoriesjyn-0/+154
to avoid going over the existing limit now that the ui-fulldeps tests have been moved to ui.
2023-02-23diagnostics: remove inconsistent English article "this" from E0107Michael Howell-2/+2
Consider `tests/ui/const-generics/generic_const_exprs/issue-102768.stderr`, the error message where it gives additional notes about where the associated type is defined, and how the dead code lint doesn't have an article, like in `tests/ui/lint/dead-code/issue-85255.stderr`. They don't have articles, so it seems unnecessary to have one here.
2023-02-22diagnostics: update test cases to refer to assoc fn with `self` as methodMichael Howell-5/+5
2023-01-14Rollup merge of #106752 - sulami:master, r=estebankMatthias Krüger-0/+14
Emit a hint for bad call return types due to generic arguments When the return type of a function call depends on the type of an argument, e.g. ``` fn foo<T>(x: T) -> T { x } ``` and the expected type is set due to either an explicitly typed binding, or because the call to the function is in a tail position without semicolon, the current error implies that the argument in the call has the wrong type. This new hint highlights that the expected type doesn't match the returned type, which matches the argument type, and that that's why we're flagging the argument type. Fixes #43608.
2023-01-13Emit a hint for bad call return types due to generic argumentsRobin Schroer-0/+14
When the return type of a function call depends on the type of an argument, e.g. ``` fn foo<T>(x: T) -> T { x } ``` and the expected type is set due to either an explicitly typed binding, or because the call to the function is in a tail position without semicolon, the current error implies that the argument in the call has the wrong type. This new hint highlights that the expected type doesn't match the returned type, which matches the argument type, and that that's why we're flagging the argument type. Fixes #43608.
2023-01-11When suggesting writing a fully qualified path probe for appropriate typesEsteban Küber-1/+6
Fix #46585.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+589