Skip to content

Commit

Permalink
Deny use of println! and related write macros (#13800)
Browse files Browse the repository at this point in the history
We lint against the `print` builtin in Python space, since it's a
debugging artifact almost all of the time.  This is the equivalent lint,
but for Rust space.
  • Loading branch information
jakelishman authored Feb 6, 2025
1 parent 3e947a7 commit 9ba33cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ qiskit-qasm3 = { path = "crates/qasm3" }
# which uses the `::std::cmp::Ordering` enum as a return. Both styles are acceptable, and the `if`
# chain can be more legible to people.
comparison-chain = "allow"
# Forbid `{,e}print{,ln}!` calls. These can be allowed locally if absolutely required, but the
# vast majority of these are debug statements that we forget about.
print_stdout = "deny"
print_stderr = "deny"

[workspace.lints.rust]
# In Rust 2021, the bodies of `unsafe fn` may use `unsafe` functions themselves without marking
Expand Down

0 comments on commit 9ba33cc

Please sign in to comment.