Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "auto_impl"
version = "1.3.0"
version = "1.4.0"
authors = [
"Ashley Mannix <ashleymannix@live.com.au>",
"Lukas Kalbertodt <lukas.kalbertodt@gmail.com>",
Expand Down
4 changes: 0 additions & 4 deletions examples/refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@ use auto_impl::auto_impl;
/// ```
#[auto_impl(&, Box)]
trait DisplayCollection {
/// If the length is statically known, this is `Some(len)`.
const LEN: Option<usize>;
type Out: Display;
fn display_at(&self, index: usize) -> Option<&Self::Out>;
}

impl<T: Display> DisplayCollection for Vec<T> {
type Out = T;

const LEN: Option<usize> = None;

fn display_at(&self, index: usize) -> Option<&Self::Out> {
self.get(index)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/compile-fail/fn_generics.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tests/compile-fail/super_trait_not_implemented.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ error[E0277]: the trait bound `Box<Dog>: Foo` is not satisfied
note: required for `Box<Dog>` 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
Expand Down
12 changes: 8 additions & 4 deletions tests/compile-fail/trait_obj_value_self.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>`
help: the trait `Trait` is conditionally implemented for `Box<T>`
--> tests/compile-fail/trait_obj_value_self.rs:4:1
|
4 | #[auto_impl(Box)]
| ^^^^^^^^^^^^^^^^^ unsatisfied requirement introduced here: `_: Sized`
note: required for `Box<dyn Trait>` 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<T: Trait>() {}
9 | fn assert_impl<T: Trait>() {}
| ^^^^^ 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)
Loading