From 51d199621803ba242ff9f0e31acb4f1c0845251d Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Sat, 26 Dec 2020 08:11:19 +0000 Subject: [PATCH] ci: deny warnings using RUSTFLAGS --- .github/workflows/ci.yml | 1 + CHANGELOG.md | 1 + Contributing.md | 4 +++- src/lib.rs | 1 - 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc89d23d1b1..5905894ae2a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,7 @@ jobs: env: RUST_BACKTRACE: 1 + RUSTFLAGS: "-D warnings" coverage: needs: [fmt] diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cd12d0f2f5..ef1f106677c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Fixed - Stop including `Py_TRACE_REFS` config setting automatically if `Py_DEBUG` is set on Python 3.8 and up. [#1334](https://github.com/PyO3/pyo3/pull/1334) +- Remove `#[deny(warnings)]` attribute (and instead refuse warnings only in CI). [#1340](https://github.com/PyO3/pyo3/pull/1340) ## [0.13.0] - 2020-12-22 ### Packaging diff --git a/Contributing.md b/Contributing.md index a8cedffe125..558b19b83ea 100644 --- a/Contributing.md +++ b/Contributing.md @@ -49,7 +49,9 @@ Here are a few things to note when you are writing PRs. The PyO3 repo uses Github Actions. PRs are blocked from merging if CI is not successful. -Formatting, linting and tests are checked for all Rust and Python code. Tests run with all supported Python versions with the latest stable Rust compiler, as well as for Python 3.9 with the minimum supported Rust version. +Formatting, linting and tests are checked for all Rust and Python code. In addition, all warnings in Rust code are disallowed (using `RUSTFLAGS="-D warnings"`). + +Tests run with all supported Python versions with the latest stable Rust compiler, as well as for Python 3.9 with the minimum supported Rust version. ### Minimum supported Rust version diff --git a/src/lib.rs b/src/lib.rs index b454f6a01aa..634e72e9d2a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ #![cfg_attr(feature = "nightly", feature(specialization))] #![allow(clippy::missing_safety_doc)] // FIXME (#698) -#![deny(warnings)] //! Rust bindings to the Python interpreter. //!