Skip to content

Commit

Permalink
Make rustc_errors::DiagCtxtHandle::warn no longer a disallowed method
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Sep 8, 2024
1 parent 374f0f1 commit 5d30ed8
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
disallowed-methods = [
{ path = "rustc_errors::DiagCtxtHandle::warn", reason = "ensure `DiagCtxtHandle::warn` is not called from `register_lints`" },
{ path = "std::process::Command::output", reason = "use `CommandExt::logged_output`" },
]
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ impl MissingDocCommentOpenai {
impl<'tcx> LateLintPass<'tcx> for MissingDocCommentOpenai {
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
if std::env::var(OPENAI_API_KEY).is_err() {
#[expect(clippy::disallowed_methods)]
cx.sess().dcx().warn(format!(
"`missing_doc_comment_openai` suggestions are disabled because environment \
variable `{OPENAI_API_KEY}` is not set"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ where
FnKind::ItemFn(ident, _, _) | FnKind::Method(ident, _) => format!("`{ident}`"),
FnKind::Closure => "closure".to_owned(),
};
#[allow(clippy::disallowed_methods)]
self.cx.sess().dcx().warn(format!(
"reached work limit ({}) while checking {}; set `{}.work_limit` in `dylint.toml` \
to override",
Expand Down
1 change: 0 additions & 1 deletion examples/general/non_thread_safe_call_in_test/src/late.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ impl_lint_pass!(NonThreadSafeCallInTest => [NON_THREAD_SAFE_CALL_IN_TEST]);
impl<'tcx> LateLintPass<'tcx> for NonThreadSafeCallInTest {
fn check_crate(&mut self, cx: &LateContext<'tcx>) {
if !cx.sess().opts.test {
#[allow(clippy::disallowed_methods)]
cx.sess().dcx().warn(
"`non_thread_safe_call_in_test` is unlikely to be effective as `--test` was not \
passed to rustc",
Expand Down

0 comments on commit 5d30ed8

Please sign in to comment.