Actually enforce clippy lints in CI (#767)

* Actually enforce clippy lints in CI

* Fix a couple clippy lints in `esp-riscv-rt`

* Fix a couple clippy lints for `esp32c6-lp-hal`
This commit is contained in:
Jesse Braham 2023-08-30 10:30:36 -07:00 committed by GitHub
parent 4dd9fbdb7b
commit c63f40f412
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 12 deletions

View File

@ -476,17 +476,17 @@ jobs:
# Run clippy on all packages targeting RISC-V.
- name: clippy (esp-riscv-rt)
run: cargo +stable clippy --manifest-path=esp-riscv-rt/Cargo.toml -- --no-deps
run: cargo +stable clippy --manifest-path=esp-riscv-rt/Cargo.toml -- -D warnings
- name: clippy (esp32c2-hal)
run: cargo +stable clippy --manifest-path=esp32c2-hal/Cargo.toml -- --no-deps
run: cargo +stable clippy --manifest-path=esp32c2-hal/Cargo.toml -- -D warnings
- name: clippy (esp32c3-hal)
run: cargo +stable clippy --manifest-path=esp32c3-hal/Cargo.toml -- --no-deps
run: cargo +stable clippy --manifest-path=esp32c3-hal/Cargo.toml -- -D warnings
- name: clippy (esp32c6-hal)
run: cargo +stable clippy --manifest-path=esp32c6-hal/Cargo.toml -- --no-deps
run: cargo +stable clippy --manifest-path=esp32c6-hal/Cargo.toml -- -D warnings
- name: clippy (esp32c6-lp-hal)
run: cargo +stable clippy --manifest-path=esp32c6-lp-hal/Cargo.toml -- --no-deps
run: cargo +stable clippy --manifest-path=esp32c6-lp-hal/Cargo.toml -- -D warnings -A asm-sub-register
- name: clippy (esp32h2-hal)
run: cargo +stable clippy --manifest-path=esp32h2-hal/Cargo.toml -- --no-deps
run: cargo +stable clippy --manifest-path=esp32h2-hal/Cargo.toml -- -D warnings
clippy-xtensa:
runs-on: ubuntu-latest
@ -499,15 +499,12 @@ jobs:
- uses: Swatinem/rust-cache@v2
# Run clippy on all packages targeting Xtensa.
#
# The ESP32-S2 requires some additional information in order for the
# atomic emulation crate to build.
- name: clippy (esp32-hal)
run: cargo +esp clippy --manifest-path=esp32-hal/Cargo.toml -- --no-deps
run: cargo +esp clippy --manifest-path=esp32-hal/Cargo.toml -- -D warnings
- name: clippy (esp32s2-hal)
run: cargo +esp clippy --manifest-path=esp32s2-hal/Cargo.toml -- --no-deps
run: cargo +esp clippy --manifest-path=esp32s2-hal/Cargo.toml -- -D warnings
- name: clippy (esp32s3-hal)
run: cargo +esp clippy --manifest-path=esp32s3-hal/Cargo.toml -- --no-deps
run: cargo +esp clippy --manifest-path=esp32s3-hal/Cargo.toml -- -D warnings
rustfmt:
runs-on: ubuntu-latest

View File

@ -48,6 +48,11 @@ extern "C" {
///
/// Zeros bss section, initializes data section and calls main. This function
/// never returns.
///
/// # Safety
///
/// This function should not be called directly by the user, and should instead
/// be invoked by the runtime implicitly.
#[link_section = ".init.rust"]
#[export_name = "_start_rust"]
pub unsafe extern "C" fn start_rust(a0: usize, a1: usize, a2: usize) -> ! {
@ -115,6 +120,11 @@ pub struct TrapFrame {
/// `scause`/`mcause` is read to determine the cause of the trap. XLEN-1 bit
/// indicates if it's an interrupt or an exception. The result is examined and
/// ExceptionHandler or one of the core interrupt handlers is called.
///
/// # Safety
///
/// This function should not be called directly by the user, and should instead
/// be invoked by the runtime implicitly.
#[link_section = ".trap.rust"]
#[export_name = "_start_trap_rust"]
pub unsafe extern "C" fn start_trap_rust(trap_frame: *const TrapFrame) {

View File

@ -19,6 +19,12 @@ impl Delay {
}
}
impl Default for Delay {
fn default() -> Self {
Self::new()
}
}
impl DelayUs<u64> for Delay {
#[inline(always)]
fn delay_us(&mut self, us: u64) {