rust/compiler/rustc_hir_analysis
Matthias Krüger b5955e74e8
Rollup merge of #138126 - compiler-errors:rtn-for-sugg, r=oli-obk
Add an opt-out in pretty printing for RTN rendering

Today, we render RPITIT types like `impl Sized { T::method(..) }` when RTN is enabled. This is very useful for diagnostics, since it's often not clear what the `impl Sized` type means by itself, and it makes it clear that that's an RPITIT that can be bounded using RTN syntax. See #115624.

However, since we don't distinguish types that are rendered for the purposes of printing messages vs suggestions, this representation leaks into suggestions and turns into code that can't be parsed. This PR adds a new `with_types_for_suggestion! {}` and `with_types_for_signature! {}` options to the pretty printing architecture to make it clear that we're rendering a type for code suggestions.

This can be applied later as we find that we need it.
2025-03-13 17:44:04 +01:00
..
src Rollup merge of #138126 - compiler-errors:rtn-for-sugg, r=oli-obk 2025-03-13 17:44:04 +01:00
Cargo.toml Revert "Use workspace lints for crates in compiler/ #138084" 2025-03-10 18:12:47 +08:00
messages.ftl Implement #[define_opaque] attribute for functions. 2025-03-11 12:05:02 +00:00
README.md rustc_typeck to rustc_hir_analysis 2022-09-27 10:37:23 +02:00

For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.