about summary refs log tree commit diff
path: root/tests/ui/trait-bounds
AgeCommit message (Collapse)AuthorLines
2023-11-24Show number in error message even for one errorNilstrieb-6/+6
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-03Rollup merge of #117505 - estebank:issue-117501, r=TaKO8KiMatthias Krüger-0/+42
Fix incorrect trait bound restriction suggestion Suggest ``` error[E0308]: mismatched types --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12 | LL | pub fn foo<A: MyTrait, B>(a: A) -> B { | - - expected `B` because of return type | | | expected this type parameter LL | return a.bar(); | ^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<A as MyTrait>::T` help: consider further restricting this bound | LL | pub fn foo<A: MyTrait<T = B>, B>(a: A) -> B { | +++++++ ``` instead of ``` error[E0308]: mismatched types --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12 | LL | pub fn foo<A: MyTrait, B>(a: A) -> B { | - - expected `B` because of return type | | | expected this type parameter LL | return a.bar(); | ^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<A as MyTrait>::T` help: consider further restricting this bound | LL | pub fn foo<A: MyTrait + <T = B>, B>(a: A) -> B { | +++++++++ ``` Fix #117501.
2023-11-02Pretty print Fn traits in rustc_on_unimplementedMichael Goulet-10/+10
2023-11-02Fix incorrect trait bound restriction suggestionEsteban Küber-0/+42
Suggest ``` error[E0308]: mismatched types --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12 | LL | pub fn foo<A: MyTrait, B>(a: A) -> B { | - - expected `B` because of return type | | | expected this type parameter LL | return a.bar(); | ^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<A as MyTrait>::T` help: consider further restricting this bound | LL | pub fn foo<A: MyTrait<T = B>, B>(a: A) -> B { | +++++++ ``` instead of ``` error[E0308]: mismatched types --> $DIR/restrict-assoc-type-of-generic-bound.rs:9:12 | LL | pub fn foo<A: MyTrait, B>(a: A) -> B { | - - expected `B` because of return type | | | expected this type parameter LL | return a.bar(); | ^^^^^^^ expected type parameter `B`, found associated type | = note: expected type parameter `B` found associated type `<A as MyTrait>::T` help: consider further restricting this bound | LL | pub fn foo<A: MyTrait + <T = B>, B>(a: A) -> B { | +++++++++ ``` Fix #117501.
2023-10-09Extend impl's def_span to include where clausesMichael Goulet-2/+5
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+6
2023-09-07diagnostics: add test case for trait bounds diagnosticMichael Howell-0/+18
Closes #82038 It was fixed by b8e5ab20ed7a7677a998a163ccf7853764b195e6, a wide-reaching obligation tracking improvement. This commit adds a test case.
2023-08-25Walk through full path in point_at_path_if_possibleMichael Goulet-0/+19
2023-06-15change `std::marker::Sized` to just `Sized`Lukas Markeffsky-19/+15
2023-06-15tweak suggestion for argument-position `impl ?Sized`Lukas Markeffsky-0/+45
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-2/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-2/+4
2023-01-12Only point at impl self ty in WF if trait predicate shares self tyMichael Goulet-4/+4
2023-01-12Point at impl self type for impl wf obligationsMichael Goulet-18/+18
2023-01-11Move /src/test to /testsAlbert Larsan-0/+813