Skip to content

Commit

Permalink
Add tests for issue knurling-rs#799
Browse files Browse the repository at this point in the history
  • Loading branch information
Sympatron committed Dec 15, 2023
1 parent c6e0e95 commit 4676d5d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions defmt/tests/derive-bounds.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
fn main() {
let baz: Baz<Qux> = Default::default();
defmt::info!("{}", baz);
}

trait Foo {
type Bar;
}
#[derive(defmt::Format, Default)]
struct Baz<T: Foo> {
field: T::Bar,
field2: Quux<T>,
}
#[derive(defmt::Format, Default)]
struct Qux;
impl Foo for Qux {
type Bar = Qux;
}
#[allow(dead_code)]
#[derive(defmt::Format, Default)]
enum Quux<T: Foo> {
#[default]
None,
Variant1(T),
Variant2 {
f: T::Bar,
},
Variant3(T::Bar),
}
1 change: 1 addition & 0 deletions defmt/tests/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ fn ui() {
t.compile_fail("tests/ui/*.rs");

t.pass("tests/basic_usage.rs");
t.pass("tests/derive-bounds.rs");
}
}

0 comments on commit 4676d5d

Please sign in to comment.