Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 94a7f23

Browse files
committed
Deny warnings in CI
The main crate already has `#![deny(warnings)]`. Set RUSTFLAGS in CI to enforce this for other crates in the workspace.
1 parent a1e8a5b commit 94a7f23

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: CI
22
on: [push, pull_request]
33

4+
env:
5+
RUSTDOCFLAGS: -Dwarnings
6+
RUSTFLAGS: -Dwarnings
7+
48
jobs:
59
docker:
610
name: Docker

build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ use std::env;
22

33
fn main() {
44
println!("cargo:rerun-if-changed=build.rs");
5+
println!("cargo::rustc-check-cfg=cfg(assert_no_panic)");
6+
println!("cargo::rustc-check-cfg=cfg(feature, values(\"unstable\"))");
57

68
#[cfg(feature = "musl-reference-tests")]
79
musl_reference_tests::generate();
810

11+
println!("cargo::rustc-check-cfg=cfg(feature, values(\"checked\"))");
12+
#[allow(unexpected_cfgs)]
913
if !cfg!(feature = "checked") {
1014
let lvl = env::var("OPT_LEVEL").unwrap();
1115
if lvl != "0" {

ci/run-docker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ run() {
1616
docker run \
1717
--rm \
1818
--user $(id -u):$(id -g) \
19+
-e "RUSTFLAGS=${RUSTFLAGS:-}" \
1920
-e CARGO_HOME=/cargo \
2021
-e CARGO_TARGET_DIR=/target \
2122
-v "${HOME}/.cargo":/cargo \

crates/compiler-builtins-smoke-test/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ authors = ["Jorge Aparicio <[email protected]>"]
77
test = false
88
bench = false
99

10+
[features]
11+
unstable = []
12+
checked = []
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("cargo::rustc-check-cfg=cfg(assert_no_panic)");
3+
}

0 commit comments

Comments
 (0)