-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Allow storing format_args!() in variable or const #139135
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: master
Are you sure you want to change the base?
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
3b4d57d
to
627b48c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
627b48c
to
25d0db8
Compare
This comment has been minimized.
This comment has been minimized.
25d0db8
to
2a4d503
Compare
This comment has been minimized.
This comment has been minimized.
2a4d503
to
44b1861
Compare
One day, clippy will not break when I make any change to format_args!(). That day is not today. |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
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 agree these tests should not rely on formatting machinery, but they also should not be deleted.
And this particular test here does not even seem to rely on formating machinery...?
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
I've opened a separate issue for the panic discussion: #139621 |
☔ The latest upstream changes (presumably #139632) made this pull request unmergeable. Please resolve the merge conflicts. |
3db7f57
to
a364c4b
Compare
This makes it posisble to do: let f = format_args!("Hello, {name}!");
We can now just make new_v1_formatted an unsafe fn.
These tests rely on internal implementation details of format_args!(), which have changed now.
a364c4b
to
3fbcdc0
Compare
Fixes #92698
Tracking issue for super let: #139076
This change allows:
This will need an FCP.
This accidentally 'fixes' a bunch of tests/ui/codegen/equal-pointers-unequal/* tests. Those tests seem very fragile and should probably not depend on formatting implementation details.
This accidentally 'fixes' tests/ui/consts/const-eval/format.rs: it now allows anypanic!()
in a const fn. This might be expected. But we should then work on a better error when such a panic!() is const evaluated. (Now it reaches unreachable_unchecked().)