chore: Use origin rendering code for suggestions#388
Open
scrabsha wants to merge 2 commits intorust-lang:mainfrom
Open
chore: Use origin rendering code for suggestions#388scrabsha wants to merge 2 commits intorust-lang:mainfrom
scrabsha wants to merge 2 commits intorust-lang:mainfrom
Conversation
ebad973 to
533a86d
Compare
533a86d to
c3c0622
Compare
epage
reviewed
Mar 16, 2026
Contributor
There was a problem hiding this comment.
chore: Bump MSRV to 1.88.0, use let chains
As noted at #378 (comment), as we don't have an MSRV policy MSRV bumps should not be done without discussion.
Also, this commit seems unrelated to this PR
Contributor
Author
There was a problem hiding this comment.
Also, this commit seems unrelated to this PR
i wasn't satisfied with what the code looked like when i wrote the first commit and figured it would be a good idea to see how it renders if let chains were used. i tried and was much happier with my changes. i still kept it as a separate commit so it's easier review (and remove if y'all are ok with the code as it is at f4a9639). the other edits in c3c0622 are required to make CI pass.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
it turns out
emit_suggestion_defaulthas its own code to display the origin at which a suggestion should be applied.i think this is not optimal because some code is duplicated, and keeping it as leads to even more duplication being added as part of my work on #386.
this commit removes the custom origin display code in
emit_suggestion_defaultand usesrender_origin(which AFAIK is used everywhere else inannotate_snippets) instead.i ran
rustc'stest/uitests against this change and it resulted in no oracle change. while i cannot assert rendering hasn't changed at all, i am reasonably confident that this commit does not break anything.first commit adds what is described above. second commit uses let chains (which IMO makes the code clearer) and bumps the MSRV to 1.88.0 (released on 26 June, 2025), which is required for let chains. happy to drop the second commit if y'all think this does not warrant an MSRV bump. to be clear, having let chains would help a lot for #386 as well. it's not just this PR.