Skip to content

Commit 32e7d04

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 32e7d04

File tree

6 files changed

+16
-1
lines changed

6 files changed

+16
-1
lines changed

.github/workflows/main.yml

+4
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

+4
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

+1
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 \
1920
-e CARGO_HOME=/cargo \
2021
-e CARGO_TARGET_DIR=/target \
2122
-v "${HOME}/.cargo":/cargo \

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

+3
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 = []
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+
}

crates/compiler-builtins-smoke-test/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
#![no_std]
77

88
#[path = "../../../src/math/mod.rs"]
9-
mod libm;
9+
pub mod libm;

0 commit comments

Comments
 (0)