-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
core, std, proc_macro: inline format!() args (1) #114067
core, std, proc_macro: inline format!() args (1) #114067
Conversation
note to self; reapply this: #114019 (review) edit: done! |
0de23f5
to
292cc3a
Compare
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 would prefer we not for the cases where the reading is not trivial.
library/core/src/str/mod.rs
Outdated
s_trunc, | ||
ellipsis | ||
); | ||
assert!(begin <= end, "begin <= end ({begin} <= {end}) when slicing `{s_trunc}`{ellipsis}"); |
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.
This is much harder to parse, for me.
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.
Hm interesting, I find this much easier to read in one go, instead of having to jump back and forth between the {}
s and the actual fmt arguments to figure out which one is the nth so it corresponds to the nth arg, etc.
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.
It's just the string "(begin <= end, "begin <= end ({begin} <= {end})"
being here is confusing for me, it might actually be better if the identifier name was less repetitive with the messaging.
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 don't have any objection to "`{s_trunc}`{ellipsis}" for instance.
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.
assert!((begin <= end), "begin ({begin}) <= end ({end}) when slicing..")
does that read better for you?
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.
...surprisingly yes.
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.
@workingjubilee since we had actual tests for this message, I wonder if it is actually better to leave it untouched altogether, what do you think?
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'll sleep on it but my first reaction is that many tests in the test suite deliberately test the current behavior without trying to harden against future changes, on the thesis that testing the current behavior is preferable to writing a test that which would pass silently in the face of behavioral changes that might render it nonfunctional, and that in general it's fine to diff a test if you change the actual inputs to the test's criteria.
Library. |
292cc3a
to
69dbf55
Compare
69dbf55
to
fe6c6bd
Compare
@rustbot ready |
The job Click to see the possible cause of the failure (guessed by this bot)
|
xD |
@rustbot author |
☔ The latest upstream changes (presumably #112849) made this pull request unmergeable. Please resolve the merge conflicts. |
@matthiaskrgr any updates on this? thanks |
Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks |
No description provided.