about summary refs log tree commit diff
path: root/tests/ui/object-safety
AgeCommit message (Collapse)AuthorLines
2023-12-14update use of feature flagslcnr-1/+1
2023-11-24Show number in error message even for one errorNilstrieb-14/+14
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-30Auto merge of #116405 - estebank:issue-103155, r=davidtwcobors-12/+12
Detect object safety errors when assoc type is missing When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
2023-10-30Detect object safety errors when assoc type is missingEsteban Küber-12/+12
When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
2023-10-29On object safety error, mention new enum as alternativeEsteban Küber-0/+5
When we encounter a `dyn Trait` that isn't object safe, look for its implementors. If there's one, mention using it directly If there are less than 9, mention the possibility of creating a new enum and using that instead. Account for object unsafe `impl Trait on dyn Trait {}`. Make a distinction between public and sealed traits. Fix #80194.
2023-10-19Suggest relaxing implicit `type Assoc: Sized;` boundEsteban Küber-0/+44
Fix #85378.
2023-10-08always show and explain sub regionAli MJ Al-Nasrawy-7/+1
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+2
2023-09-02Do not require associated types with Self: Sized to uphold bounds when ↵Michael Goulet-21/+31
confirming object candidate
2023-08-26Remove unnecessary `select_obligations_where_possible` and redundant errorsEsteban Küber-27/+4
2023-08-26On let binding type point to type parameter that introduced unmet boundEsteban Küber-2/+25
On the following example, point at `String` instead of the whole type: ``` error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/own-bound-span.rs:14:24 | LL | let _: <S as D>::P<String>; | ^^^^^^ the trait `Copy` is not implemented for `String` | note: required by a bound in `D::P` --> $DIR/own-bound-span.rs:4:15 | LL | type P<T: Copy>; | ^^^^ required by this bound in `D::P` ```
2023-07-28Update existing UI testsLeón Orell Valerian Liehr-34/+14
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-1/+1
2023-07-05Test that you can't circumvent the `Sized` bound checkOli Scherer-0/+73
2023-07-05Make `unused_associated_type_bounds`'s lint level changeableOli Scherer-0/+3
2023-07-05Add more testsOli Scherer-0/+59
2023-07-05Lint now-unnecessary associated type boundsOli Scherer-0/+41
2023-07-05Don't require associated types with `Self: Sized` bounds in `dyn Trait` objectsOli Scherer-13/+3
2023-05-12Note base types of coercionMichael Goulet-18/+9
2023-04-20Add some tests around (lack of) object safety of associated types and constsOli Scherer-0/+141
2023-02-21Name placeholder in some region errorsMichael Goulet-0/+5
2023-01-11Move /src/test to /testsAlbert Larsan-0/+882