Skip to content

add help text where missing to lints #11810

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

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

Jacherr
Copy link
Contributor

@Jacherr Jacherr commented Nov 15, 2023

Fixes #11805

Essentially just changes the section of code that applies the lint from using cx.struct_span_lint and instead opts for span_lint_and_then, which automatically appends the help text.

changelog: add missing help text for cast_possible_wrap, mod_module_files, and self_named_module_files lints

@rustbot
Copy link
Collaborator

rustbot commented Nov 15, 2023

r? @Manishearth

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

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Nov 15, 2023
@Jacherr Jacherr changed the title replace lint with span_lint_and_then add help text to cast_possible_wrap lint Nov 15, 2023
@Jacherr Jacherr changed the title add help text to cast_possible_wrap lint add help text where missing to lints Nov 15, 2023
@Jacherr
Copy link
Contributor Author

Jacherr commented Nov 15, 2023

As per #11805 (comment), also changes the function call for the lints in module_style.rs. There could be others that haven't been spotted yet however!

@Manishearth
Copy link
Member

@bors r+

thanks!

@bors
Copy link
Contributor

bors commented Nov 15, 2023

📌 Commit 11881be has been approved by Manishearth

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 15, 2023

⌛ Testing commit 11881be with merge abf01e4...

@bors
Copy link
Contributor

bors commented Nov 15, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing abf01e4 to master...

@bors bors merged commit abf01e4 into rust-lang:master Nov 15, 2023
bors added a commit that referenced this pull request Nov 15, 2023
disallow calls to `LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir`

`LintContext::struct_span_lint` and `TyCtxt::struct_span_lint_hir` don't show the link to the clippy documentation, see: #11805

In #11810, the last few calls to those methods were replaced with `span_lint_*`. It seems like we should just disallow them altogether so that no new code tries to use them.

The existing `disallowed_methods` lint makes this easy.

changelog: none
@Jacherr Jacherr deleted the cast-possible-wrap-link branch November 16, 2023 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing link to cast_possible_wrap
4 participants