Commit Graph

9 Commits

Author SHA1 Message Date
Oli Scherer
3fff727e87 Use more detailed spans in dyn compat errors within bodies 2025-05-27 08:18:11 +00:00
León Orell Valerian Liehr
57b5d3af62 Compiler: Finalize dyn compatibility renaming 2025-01-26 21:20:31 +01:00
Taylor Cramer
d00d4dfe0d Refactor dyn-compatibility error and suggestions
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-22 09:20:57 -08:00
León Orell Valerian Liehr
01a063f9df Compiler: Rename "object safe" to "dyn compatible" 2024-09-25 13:26:48 +02:00
xFrednet
8b14e23dce RFC 2383: Stabilize lint_reasons 🎉 2024-06-25 17:22:22 +02:00
Nilstrieb
41e8d152dc Show number in error message even for one error
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-24 19:15:52 +01:00
Esteban Küber
8c04999226 On object safety error, mention new enum as alternative
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-29 23:55:46 +00:00
Santiago Pastorino
20429af7a3 Replace RPITIT current impl with new strategy that lowers as a GAT 2023-07-08 18:21:34 -03:00
Michael Goulet
ed468eebf6 Encode def span for foreign RPITITs 2023-04-30 21:52:35 +00:00