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

Update unstable lint docs to include required feature attributes #135406

Merged
merged 2 commits into from
Jan 13, 2025

Conversation

Aditya-PS-05
Copy link
Contributor

closes #135298

Summary

This PR updates the documentation examples for the following unstable lints to ensure they include the necessary feature attributes for proper usage:

  • fuzzy_provenance_casts
  • lossy_provenance_casts
  • unqualified_local_imports
  • test_unstable_lint

Changes Made:

  • Added the appropriate #![feature(...)] attributes to the example code for each lint.
  • Updated the examples to produce correct and meaningful warnings, ensuring they align with current lint behavior.

Reference:

  • Used the must_not_suspend lint documentation as a template for these updates.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2025

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BoxyUwU (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 12, 2025
@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 12, 2025

📌 Commit 5621077 has been approved by compiler-errors

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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 12, 2025
@@ -4033,6 +4035,7 @@ declare_lint! {
/// ### Example
///
/// ```rust
/// #![feature(test_unstable_lint)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this one is intentionally meant to exercise the lint in question...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please remove this attribute, and instead leave a comment saying that this lint is simply meant to test the compiler's behavior when an unstable lint is enabled without the corresponding feature gate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah sure

@compiler-errors
Copy link
Member

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 12, 2025
@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 12, 2025

📌 Commit 7ece88a has been approved by compiler-errors

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: This is awaiting some action (such as code changes or more information) from the author. labels Jan 12, 2025
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jan 12, 2025
…s, r=compiler-errors

Update unstable lint docs to include required feature attributes

closes rust-lang#135298

## Summary
This PR updates the documentation examples for the following unstable lints to ensure they include the necessary feature attributes for proper usage:

- fuzzy_provenance_casts
- lossy_provenance_casts
- unqualified_local_imports
- test_unstable_lint

## Changes Made:

- Added the appropriate #![feature(...)] attributes to the example code for each lint.
- Updated the examples to produce correct and meaningful warnings, ensuring they align with current lint behavior.

Reference:
- Used the `must_not_suspend` lint documentation as a template for these updates.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 12, 2025
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#135348 (rustdoc-json: Include items in stripped modules in `Crate::paths`.)
 - rust-lang#135365 (Update the explanation for why we use box_new in vec!)
 - rust-lang#135383 (De-abstract tagged ptr and make it covariant)
 - rust-lang#135401 (Remove some empty expected files to fix blessing)
 - rust-lang#135406 (Update unstable lint docs to include required feature attributes)
 - rust-lang#135407 (Deny various clippy lints)
 - rust-lang#135411 (run_make_support: add `#![warn(unreachable_pub)]`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d8e88c9 into rust-lang:master Jan 13, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 13, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 13, 2025
Rollup merge of rust-lang#135406 - Aditya-PS-05:fix/unstable-lint-docs, r=compiler-errors

Update unstable lint docs to include required feature attributes

closes rust-lang#135298

## Summary
This PR updates the documentation examples for the following unstable lints to ensure they include the necessary feature attributes for proper usage:

- fuzzy_provenance_casts
- lossy_provenance_casts
- unqualified_local_imports
- test_unstable_lint

## Changes Made:

- Added the appropriate #![feature(...)] attributes to the example code for each lint.
- Updated the examples to produce correct and meaningful warnings, ensuring they align with current lint behavior.

Reference:
- Used the `must_not_suspend` lint documentation as a template for these updates.
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
…llaumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#135348 (rustdoc-json: Include items in stripped modules in `Crate::paths`.)
 - rust-lang#135365 (Update the explanation for why we use box_new in vec!)
 - rust-lang#135383 (De-abstract tagged ptr and make it covariant)
 - rust-lang#135401 (Remove some empty expected files to fix blessing)
 - rust-lang#135406 (Update unstable lint docs to include required feature attributes)
 - rust-lang#135407 (Deny various clippy lints)
 - rust-lang#135411 (run_make_support: add `#![warn(unreachable_pub)]`)

r? `@ghost`
`@rustbot` modify labels: rollup
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken unstable lint examples in rustc book
5 participants