diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 638ad70..295a43d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,17 +9,16 @@ env: jobs: check: name: 'Build & test' - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: rust-version: ['stable', 'beta', 'nightly', '1.71'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@master with: toolchain: stable components: rustfmt, clippy - - uses: Swatinem/rust-cache@v1 - run: cargo fmt --all -- --check - run: cargo clippy --workspace --all-features -- -D warnings diff --git a/Cargo.toml b/Cargo.toml index d83b1f8..440ff0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "auto_impl" -version = "1.3.0" +version = "1.4.0" authors = [ "Ashley Mannix ", "Lukas Kalbertodt ", diff --git a/examples/refs.rs b/examples/refs.rs index 68b2a52..aa3e5e2 100644 --- a/examples/refs.rs +++ b/examples/refs.rs @@ -25,8 +25,6 @@ use auto_impl::auto_impl; /// ``` #[auto_impl(&, Box)] trait DisplayCollection { - /// If the length is statically known, this is `Some(len)`. - const LEN: Option; type Out: Display; fn display_at(&self, index: usize) -> Option<&Self::Out>; } @@ -34,8 +32,6 @@ trait DisplayCollection { impl DisplayCollection for Vec { type Out = T; - const LEN: Option = None; - fn display_at(&self, index: usize) -> Option<&Self::Out> { self.get(index) } diff --git a/tests/compile-fail/fn_generics.stderr b/tests/compile-fail/fn_generics.stderr index 04221a5..456e733 100644 --- a/tests/compile-fail/fn_generics.stderr +++ b/tests/compile-fail/fn_generics.stderr @@ -10,4 +10,4 @@ warning: unused import: `std::fmt::Display` 1 | use std::fmt::Display; | ^^^^^^^^^^^^^^^^^ | - = note: `#[warn(unused_imports)]` on by default + = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default diff --git a/tests/compile-fail/super_trait_not_implemented.stderr b/tests/compile-fail/super_trait_not_implemented.stderr index 96b16ef..d77f554 100644 --- a/tests/compile-fail/super_trait_not_implemented.stderr +++ b/tests/compile-fail/super_trait_not_implemented.stderr @@ -9,9 +9,9 @@ error[E0277]: the trait bound `Box: Foo` is not satisfied note: required for `Box` to implement `Foo` --> tests/compile-fail/super_trait_not_implemented.rs:5:1 | -5 | #[auto_impl(Box, &)] + 5 | #[auto_impl(Box, &)] | ^^^^^^^^^^^^^^^^^^^^ -6 | trait Foo: Supi {} + 6 | trait Foo: Supi {} | ^^^ ---- unsatisfied trait bound introduced here note: required by a bound in `requires_foo` --> tests/compile-fail/super_trait_not_implemented.rs:14:20 diff --git a/tests/compile-fail/trait_obj_value_self.stderr b/tests/compile-fail/trait_obj_value_self.stderr index 1009a79..b15ab8d 100644 --- a/tests/compile-fail/trait_obj_value_self.stderr +++ b/tests/compile-fail/trait_obj_value_self.stderr @@ -5,17 +5,21 @@ error[E0277]: the size for values of type `dyn Trait` cannot be known at compila | ^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn Trait` - = help: the trait `Trait` is implemented for `Box` +help: the trait `Trait` is conditionally implemented for `Box` + --> tests/compile-fail/trait_obj_value_self.rs:4:1 + | + 4 | #[auto_impl(Box)] + | ^^^^^^^^^^^^^^^^^ unsatisfied requirement introduced here: `_: Sized` note: required for `Box` to implement `Trait` --> tests/compile-fail/trait_obj_value_self.rs:4:1 | -4 | #[auto_impl(Box)] + 4 | #[auto_impl(Box)] | ^^^^^^^^^^^^^^^^^ -5 | trait Trait { + 5 | trait Trait { | ^^^^^ note: required by a bound in `assert_impl` --> tests/compile-fail/trait_obj_value_self.rs:9:19 | -9 | fn assert_impl() {} + 9 | fn assert_impl() {} | ^^^^^ required by this bound in `assert_impl` = note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info)