Skip to content

Commit

Permalink
Merge pull request #536 from jannic/fix_clippy_warnings
Browse files Browse the repository at this point in the history
Fix clippy warnings
  • Loading branch information
newAM authored May 26, 2024
2 parents 4395bae + 8ab3799 commit f3f85e6
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions cortex-m-rt/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ INCLUDE device.x"#
f
};

println!("cargo:rustc-check-cfg=cfg(armv6m)");
println!("cargo:rustc-check-cfg=cfg(armv7m)");
println!("cargo:rustc-check-cfg=cfg(armv8m)");
println!("cargo:rustc-check-cfg=cfg(cortex_m)");
println!("cargo:rustc-check-cfg=cfg(has_fpu)");

let max_int_handlers = if target.starts_with("thumbv6m-") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv6m");
Expand Down
2 changes: 2 additions & 0 deletions cortex-m-rt/examples/cfg-static.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#![deny(warnings)]
#![no_main]
#![no_std]
// This example uses an undefined cfg, `cfg(never)`
#![allow(unexpected_cfgs)]

extern crate cortex_m_rt as rt;
extern crate panic_halt;
Expand Down
1 change: 1 addition & 0 deletions cortex-m-semihosting/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::env;
fn main() {
let target = env::var("TARGET").unwrap();

println!("cargo:rustc-check-cfg=cfg(thumb)");
if target.starts_with("thumbv") {
println!("cargo:rustc-cfg=thumb");
}
Expand Down
10 changes: 10 additions & 0 deletions cortex-m/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ fn main() {
let target = env::var("TARGET").unwrap();
let host_triple = env::var("HOST").unwrap();

println!("cargo:rustc-check-cfg=cfg(armv6m)");
println!("cargo:rustc-check-cfg=cfg(armv7em)");
println!("cargo:rustc-check-cfg=cfg(armv7m)");
println!("cargo:rustc-check-cfg=cfg(armv8m)");
println!("cargo:rustc-check-cfg=cfg(armv8m_base)");
println!("cargo:rustc-check-cfg=cfg(armv8m_main)");
println!("cargo:rustc-check-cfg=cfg(cortex_m)");
println!("cargo:rustc-check-cfg=cfg(has_fpu)");
println!("cargo:rustc-check-cfg=cfg(native)");

if host_triple == target {
println!("cargo:rustc-cfg=native");
}
Expand Down

0 comments on commit f3f85e6

Please sign in to comment.