-
Notifications
You must be signed in to change notification settings - Fork 14k
[EXPERIMENT] DelimSpan::from_single() experiment and UI tests update. #149112
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
base: main
Are you sure you want to change the base?
Conversation
…est to see how the dianostics change. I would say a lot these are cause by using DelimSpan::open or DelimSpan::close instead of Delimspan::entire when looking at the diffs.
|
Could you make the PR description more meaningful? We shouldn't have to refer to a separate PR to know what this does, and it definitely does more than just update tests. Please also make sure to squash before merge. |
@tgross35 I updated the title of the PR, @petrochenkov wanted a separate PR for these experiments so that's what I did. I was not sure how much detail or what should be specified in such a PR. So my bad, if there is anything else please let me know. |
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
| let pos = len.checked_sub(last.len_utf8()).unwrap_or(0); | ||
| let close = sp.subspan(pos..).unwrap_or(default_close); | ||
|
|
||
| Ok(match (first, last) { |
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.
I'm not sure why the logic above is so overcomplicated.
let first = src[0] and let last = src[src.len() - 1].
open is sp.with_lo(sp.lo() + BytePos(1)) if the source map check passes, close is sp.with_hi(sp.hi() - BytePos(1)) .
This needs to be confirmed, could you check what happens at least in the case of
Of course, |
Experimental changes to DelimSpan::from_single() to have potential better open and close values.
Here is the tests output updated as you asked as a separate PR as asked here: #149052 (comment)
r? @petrochenkov