Skip to content
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

Merged
merged 5 commits into from
Jun 26, 2020

Conversation

tshepang
Copy link
Member

No description provided.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 20, 2020
@mati865
Copy link
Contributor

mati865 commented Jun 20, 2020

This was purposely changed by #72382

@tshepang
Copy link
Member Author

@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).

Copy link
Contributor

@nikomatsakis nikomatsakis left a 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.

@nikomatsakis
Copy link
Contributor

I agree that having the default values in the comments seems like a nice approach.

config.toml.example Outdated Show resolved Hide resolved
@nikomatsakis
Copy link
Contributor

I'm not sure who to loop in to get a broader range of opinions. Maybe @Mark-Simulacrum, @mark-i-m and @spastorino ? :)

Copy link
Member

@mark-i-m mark-i-m left a 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.

#
# 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.

Copy link
Contributor

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.

@nikomatsakis
Copy link
Contributor

I do like the idea of a config.toml.dev, but I guess it's a distinct PR perhaps.

Comment on lines 329 to 330
# Defaults to rust.debug value
#debug-assertions-std = false
Copy link
Contributor

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.

@spastorino
Copy link
Member

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".

@mark-i-m
Copy link
Member

@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.

@nikomatsakis
Copy link
Contributor

I'm happy with this current version.

@nikomatsakis
Copy link
Contributor

(Though we should fix the problem @tmiasko noted)

@tshepang tshepang changed the title examples should be of type bool make commented examples use valid syntax, and be more consistent Jun 24, 2020
@tshepang
Copy link
Member Author

@spastorino the PR comment got obsolete with the iterations. I updated it now.

@tshepang
Copy link
Member Author

should I squash the commits

@nikomatsakis
Copy link
Contributor

@bors r+ rollup

Meh, I don't think squashing is necessary.

@bors
Copy link
Contributor

bors commented Jun 24, 2020

📌 Commit b23baa7 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 24, 2020
Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 26, 2020
make commented examples use valid syntax, and be more consistent
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 26, 2020
…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
@bors bors merged commit 0d5cfb4 into rust-lang:master Jun 26, 2020
@tshepang tshepang deleted the fix-example branch June 26, 2020 07:36
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants