-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
make commented examples use valid syntax, and be more consistent #73538
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
This was purposely changed by #72382 |
@mati865 nice catch. I added a commit to explain more what's going on (after reading the code). That is, I'd rather we have valid syntax there, than have users experience a failing build (as I did). |
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 have observed some confusion with the current setup, where people uncomment the line and then get errors.
I agree that having the default values in the comments seems like a nice approach. |
I'm not sure who to loop in to get a broader range of opinions. Maybe @Mark-Simulacrum, @mark-i-m and @spastorino ? :) |
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.
So I feel that the values should all be sensible defaults that one can just uncomment to use, which I think is the intent of this PR.
Moreover, I feel like this PR would be complimented well by having a config.dev.toml
that has reasonable default in it that people can just cp config.dev.toml config.toml
and not have to look in the file at all.
config.toml.example
Outdated
# | ||
# Defaults to the Python interpreter used to execute x.py. | ||
#python = "python" | ||
#python = "python" # defaults to the Python interpreter used to execute x.py |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
Yeah, that's true, it did seem to blend in to me.
I do like the idea of a config.toml.dev, but I guess it's a distinct PR perhaps. |
See rust-lang#73538 (comment) for the motivation
config.toml.example
Outdated
# Defaults to rust.debug value | ||
#debug-assertions-std = false |
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 one defaults to debug-assertions and only indirectly to debug.
I like the approach of documenting to which value each thing defaults to but at the same time it seemed that that's what the previous code was doing already. I'm not sure what's the reason for the main change here like "examples should be of type bool". |
@spastorino I think the intent is that you should be able to just uncomment a line and it should work, which is not true today IIUC. |
I'm happy with this current version. |
(Though we should fix the problem @tmiasko noted) |
@spastorino the PR comment got obsolete with the iterations. I updated it now. |
should I squash the commits |
@bors r+ rollup Meh, I don't think squashing is necessary. |
📌 Commit b23baa7 has been approved by |
make commented examples use valid syntax, and be more consistent
…arth Rollup of 14 pull requests Successful merges: - rust-lang#72617 (Add a fast path for `std::thread::panicking`.) - rust-lang#72738 (Self contained linking option) - rust-lang#72770 (Implement mixed script confusable lint.) - rust-lang#73418 (Add unstable `core::mem::variant_count` intrinsic) - rust-lang#73460 (Emit line info for generator variants) - rust-lang#73534 (Provide suggestions for some moved value errors) - rust-lang#73538 (make commented examples use valid syntax, and be more consistent ) - rust-lang#73581 (Create 0766 error code) - rust-lang#73619 (Document the mod keyword) - rust-lang#73621 (Document the mut keyword) - rust-lang#73648 (Document the return keyword) - rust-lang#73673 (Fix ptr doc warnings.) - rust-lang#73674 (Tweak binop errors) - rust-lang#73687 (Clean up E0701 explanation) Failed merges: - rust-lang#73708 (Explain move errors that occur due to method calls involving `self` (take two)) r? @ghost
No description provided.