-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an opt-out in pretty printing for RTN rendering #138126
Merged
Merged
+152
−30
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6b7a441
to
7a08d03
Compare
r? oli-obk |
compiler-errors
commented
Mar 12, 2025
@@ -15,6 +15,10 @@ note: required by a bound in `is_send` | |||
| | |||
LL | fn is_send(_: impl Send) {} | |||
| ^^^^ required by this bound in `is_send` | |||
help: consider further restricting the associated type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:D
oli-obk
approved these changes
Mar 13, 2025
@bors r+ rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2025
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#138126 (Add an opt-out in pretty printing for RTN rendering) - rust-lang#138399 (Delegation: allow foreign fns `reuse`) - rust-lang#138406 (Update mdbook to 0.4.47) - rust-lang#138417 (minor interpreter cleanups) - rust-lang#138420 (Adapt to LLVM dropping CfiFunctionIndex::begin()/end()) - rust-lang#138423 (Don't emit error within cast function, propagate it as a `CastError`) - rust-lang#138425 (Remove `feature = "hash_raw_entry"`) - rust-lang#138427 (Fix RISC-V VxWorks LLVM target triples) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 13, 2025
Rollup merge of rust-lang#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 rust-lang#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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theimpl 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! {}
andwith_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.