Skip to content

Conversation

epage
Copy link
Contributor

@epage epage commented May 22, 2023

What does this PR try to resolve?

In #12115, we explored how we can let stable projects
experiment with [lints] to provide feedback. What we settled on is
switching from the cargo-features manifest key to the -Z flag as
cargo-features always requires nightly while -Z only requires it
when being passed in. This means a project can have a [lints] table
and have CI / contributors run cargo +nightly check -Zlints when they
care about warnings.

How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your PR.
With a smooth review process, a pull request usually gets reviewed quicker.

If you don't know how to write and run your tests, please read the guide:
https://doc.crates.io/contrib/tests

Additional information

I considered reworking the code to show the user the errors they would encounter once the feature is stable but held off. I wasn't quite sure what language to use and most likely a user would have something doing error reporting, like CI, so it should be fine.

epage added 2 commits May 22, 2023 13:44
In rust-lang#12115, we explored how we can let stable projects
experiment with `[lints]` to provide feedback.  What we settled on is
switching from the `cargo-features` manifest key to the `-Z` flag as
`cargo-features` always requires nightly while `-Z` only requires it
when being passed in.  This means a project can have a `[lints]` table
and have CI / contributors run `cargo +nightly check -Zlints` when they
care about warnings.
@rustbot
Copy link
Collaborator

rustbot commented May 22, 2023

r? @ehuss

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

@rustbot rustbot added A-manifest Area: Cargo.toml issues A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2023
@weihanglo
Copy link
Member

Yeah I agree Z flag is more convenient. Thanks!

@bors +

@weihanglo
Copy link
Member

bors is broken or GitHub is down?

@bors r-

@bors bors added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 23, 2023
@weihanglo
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented May 23, 2023

📌 Commit 9f71a99 has been approved by weihanglo

It is now in the queue for this repository.

@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-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. labels May 23, 2023
@bors
Copy link
Contributor

bors commented May 23, 2023

⌛ Testing commit 9f71a99 with merge f72abee...

bors added a commit that referenced this pull request May 23, 2023
fix(lints): Switch to -Zlints so stable projects can experiment

### What does this PR try to resolve?

In #12115, we explored how we can let stable projects
experiment with `[lints]` to provide feedback.  What we settled on is
switching from the `cargo-features` manifest key to the `-Z` flag as
`cargo-features` always requires nightly while `-Z` only requires it
when being passed in.  This means a project can have a `[lints]` table
and have CI / contributors run `cargo +nightly check -Zlints` when they
care about warnings.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your PR.
With a smooth review process, a pull request usually gets reviewed quicker.

If you don't know how to write and run your tests, please read the guide:
https://doc.crates.io/contrib/tests

### Additional information

I considered reworking the code to show the user the errors they would encounter once the feature is stable but held off.  I wasn't quite sure what language to use and most likely a user would have something doing error reporting, like CI, so it should be fine.
@weihanglo
Copy link
Member

@bors r-

Oh no! We forgot to update unstable.md!

@bors bors added S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 23, 2023
@bors
Copy link
Contributor

bors commented May 23, 2023

☀️ Try build successful - checks-actions
Build commit: f72abee (f72abeeb0f4c7321682a19165e71739076b3b3b2)

1 similar comment
@bors
Copy link
Contributor

bors commented May 23, 2023

☀️ Try build successful - checks-actions
Build commit: f72abee (f72abeeb0f4c7321682a19165e71739076b3b3b2)

@rustbot rustbot added the A-documenting-cargo-itself Area: Cargo's documentation label May 23, 2023
@epage
Copy link
Contributor Author

epage commented May 23, 2023

Thanks for catching that!

I've updated it

@weihanglo
Copy link
Member

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented May 23, 2023

📌 Commit 08fdd86 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-author Status: The marked PR is awaiting some action (such as code changes) from the PR author. label May 23, 2023
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 23, 2023
@bors
Copy link
Contributor

bors commented May 23, 2023

⌛ Testing commit 08fdd86 with merge feb9bcf...

@bors
Copy link
Contributor

bors commented May 23, 2023

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing feb9bcf to master...

1 similar comment
@bors
Copy link
Contributor

bors commented May 23, 2023

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing feb9bcf to master...

@bors
Copy link
Contributor

bors commented May 23, 2023

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

@bors bors merged commit feb9bcf into rust-lang:master May 23, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2023
Update cargo

10 commits in 09276c703a473ab33daaeb94917232e80eefd628..64fb38c97ac4d3a327fc9032c862dd28c8833b17
2023-05-16 21:43:35 +0000 to 2023-05-23 18:53:23 +0000
- Consider rust-version when selecting packages for cargo add (rust-lang/cargo#12078)
- fix(lints): Switch to -Zlints so stable projects can experiment (rust-lang/cargo#12168)
- Automatically inherit workspace fields when running cargo new/init (rust-lang/cargo#12069)
- ci: check if any version bump needed for member crates (rust-lang/cargo#12126)
- feat: `lints` feature (rust-lang/cargo#12148)
- fix: pass `-C debuginfo` after weakening if explicitly set (rust-lang/cargo#12165)
- Tweak build help to clarify role of --bin (rust-lang/cargo#12157)
- fix: Pass CI on nightly (rust-lang/cargo#12160)
- docs(source): doc comments for Source and its impls (rust-lang/cargo#12159)
- docs(source): doc comments for `Source` and friends (rust-lang/cargo#12153)

r? `@ghost`
@epage epage deleted the lints2 branch May 25, 2023 21:34
saethlin pushed a commit to saethlin/miri that referenced this pull request May 26, 2023
Update cargo

10 commits in 09276c703a473ab33daaeb94917232e80eefd628..64fb38c97ac4d3a327fc9032c862dd28c8833b17
2023-05-16 21:43:35 +0000 to 2023-05-23 18:53:23 +0000
- Consider rust-version when selecting packages for cargo add (rust-lang/cargo#12078)
- fix(lints): Switch to -Zlints so stable projects can experiment (rust-lang/cargo#12168)
- Automatically inherit workspace fields when running cargo new/init (rust-lang/cargo#12069)
- ci: check if any version bump needed for member crates (rust-lang/cargo#12126)
- feat: `lints` feature (rust-lang/cargo#12148)
- fix: pass `-C debuginfo` after weakening if explicitly set (rust-lang/cargo#12165)
- Tweak build help to clarify role of --bin (rust-lang/cargo#12157)
- fix: Pass CI on nightly (rust-lang/cargo#12160)
- docs(source): doc comments for Source and its impls (rust-lang/cargo#12159)
- docs(source): doc comments for `Source` and friends (rust-lang/cargo#12153)

r? `@ghost`
@ehuss ehuss added this to the 1.71.0 milestone May 30, 2023
@weihanglo weihanglo added the A-lints-table Area: [lints] table label Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation A-lints-table Area: [lints] table A-manifest Area: Cargo.toml issues A-unstable Area: nightly unstable support 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.

5 participants