Skip to content

Commit

Permalink
Avoid depending on savvy
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation committed Mar 24, 2024
1 parent e361515 commit 36e18d4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
1 change: 0 additions & 1 deletion savvy-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ savvy-bindgen = { version = "0.3.0", path = "../savvy-bindgen" }

[dev-dependencies]
trybuild = "1"
savvy = { version = "0.3.0", path = "../" }

[package.metadata.dist]
dist = false
26 changes: 15 additions & 11 deletions savvy-macro/tests/cases/simple_cases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,28 @@ impl Foo1 {
}
}

struct Foo2;
// TODO

#[savvy]
impl Foo2 {}
// struct Foo2;

// #[savvy]
// impl Foo2 {}

#[savvy]
fn wrong_type_custom_type_no_ref(x: Foo2) -> savvy::Result<()> {
Ok(())
}

#[savvy]
fn correct_type_custom_type_ref(x: &Foo2) -> savvy::Result<()> {
Ok(())
}
// TODO
//
// #[savvy]
// fn correct_type_custom_type_ref(x: &Foo2) -> savvy::Result<()> {
// Ok(())
// }

#[savvy]
fn correct_type_custom_type_ref_mut(x: &mut Foo2) -> savvy::Result<()> {
Ok(())
}
// #[savvy]
// fn correct_type_custom_type_ref_mut(x: &mut Foo2) -> savvy::Result<()> {
// Ok(())
// }

fn main() {}
4 changes: 2 additions & 2 deletions savvy-macro/tests/cases/simple_cases.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ error: For safety, a function that takes `self` and returns `Self` is not allowe
| |_____^

error: A user-defined struct must be in the form of either `&Foo2` or `&mut Foo2`
--> tests/cases/simple_cases.rs:46:37
--> tests/cases/simple_cases.rs:48:37
|
46 | fn wrong_type_custom_type_no_ref(x: Foo2) -> savvy::Result<()> {
48 | fn wrong_type_custom_type_no_ref(x: Foo2) -> savvy::Result<()> {
| ^^^^

0 comments on commit 36e18d4

Please sign in to comment.