about summary refs log tree commit diff
path: root/tests/ui/methods/issues
AgeCommit message (Collapse)AuthorLines
2025-08-04Tweak auto trait errorsEsteban Küber-1/+1
Make suggestions to remove params and super traits tool-only, and make the suggestion span more accurate. ``` error[E0567]: auto traits cannot have generic parameters --> $DIR/auto-trait-validation.rs:6:19 | LL | auto trait Generic<T> {} | -------^^^ | | | auto trait cannot have generic parameters error[E0568]: auto traits cannot have super traits or lifetime bounds --> $DIR/auto-trait-validation.rs:8:20 | LL | auto trait Bound : Copy {} | ----- ^^^^ | | | auto traits cannot have super traits or lifetime bounds ``` ``` error[E0380]: auto traits cannot have associated items --> $DIR/issue-23080.rs:5:8 | LL | unsafe auto trait Trait { | ----- auto traits cannot have associated items LL | fn method(&self) { | ^^^^^^ ```
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-1/+1
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-1/+1
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-3/+2
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-03Check for generic parameter mismatches on trait functions.Jason Newcomb-1/+1
2024-05-20Note for E0599 if shadowed bindings has the method.surechen-0/+24
implement #123558
2024-03-03Be more lax in `.into_iter()` suggestion when encountering `Iterator` ↵Esteban Küber-10/+18
methods on non-`Iterator` ``` error[E0599]: no method named `map` found for struct `Vec<bool>` in the current scope --> $DIR/vec-on-unimplemented.rs:3:23 | LL | vec![true, false].map(|v| !v).collect::<Vec<_>>(); | ^^^ `Vec<bool>` is not an iterator | help: call `.into_iter()` first | LL | vec![true, false].into_iter().map(|v| !v).collect::<Vec<_>>(); | ++++++++++++ ``` We used to provide some help through `rustc_on_unimplemented` on non-`impl Trait` and non-type-params, but this lets us get rid of some otherwise unnecessary conditions in the annotation on `Iterator`.
2024-02-22Deduplicate some logic and reword outputEsteban Küber-1/+1
2024-02-22Make confusable suggestions `verbose`Esteban Küber-1/+6
2024-02-01review comment: change wordingEsteban Küber-1/+1
2024-02-01On E0277 be clearer about implicit `Sized` bounds on type params and assoc typesEsteban Küber-2/+2
``` 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-24On E0308 involving `dyn Trait`, mention trait objectsEsteban Küber-0/+1
When encountering a type mismatch error involving `dyn Trait`, mention the existence of boxed trait objects if the other type involved implements `Trait`. Partially addresses #102629.
2023-11-24Show number in error message even for one errorNilstrieb-2/+2
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-08-26More accurately point at argumentsEsteban Küber-2/+2
2023-02-25Complete migrating `ast_passes` to derive diagnosticsclubby789-1/+1
2023-02-22diagnostics: update test cases to refer to assoc fn with `self` as methodMichael Howell-1/+1
2023-01-30Modify primary span label for E0308Esteban Küber-6/+6
The previous output was unintuitive to users.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+395