diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-05 18:44:26 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-05 18:44:26 +0100 |
| commit | 8455bb19b7d4235e667cab9112aa276557969dcc (patch) | |
| tree | 3ad5a7cf2941c4918f9e6de612a711cd8846570f /examples/14-imports/output/rust/src | |
| parent | 266e826749b62c46e14d9590351f8c3b2de53512 (diff) | |
Type check generic native types
Diffstat (limited to 'examples/14-imports/output/rust/src')
| -rw-r--r-- | examples/14-imports/output/rust/src/lib.rs | 15 | ||||
| -rw-r--r-- | examples/14-imports/output/rust/src/line.rs | 8 | ||||
| -rw-r--r-- | examples/14-imports/output/rust/src/point.rs | 8 |
3 files changed, 31 insertions, 0 deletions
diff --git a/examples/14-imports/output/rust/src/lib.rs b/examples/14-imports/output/rust/src/lib.rs new file mode 100644 index 0000000..ffbcbf4 --- /dev/null +++ b/examples/14-imports/output/rust/src/lib.rs @@ -0,0 +1,15 @@ +mod line; +mod point; + +#[cfg(test)] +mod test { + use super::line::Line; + use super::point::Point; + + #[test] + fn can_construct_line() { + let start = Point { x: 10, y: 25 }; + let end = Point { x: 10, y: 25 }; + let line = Line { start, end }; + } +} diff --git a/examples/14-imports/output/rust/src/line.rs b/examples/14-imports/output/rust/src/line.rs new file mode 100644 index 0000000..8561605 --- /dev/null +++ b/examples/14-imports/output/rust/src/line.rs @@ -0,0 +1,8 @@ +// Generated by hobgoblin. + +/// A straight line from one point to another. +#[derive(Clone, Debug, Hash, PartialEq)] +pub struct Line { + pub start: crate::point::Point, + pub end: crate::point::Point, +} diff --git a/examples/14-imports/output/rust/src/point.rs b/examples/14-imports/output/rust/src/point.rs new file mode 100644 index 0000000..6d9b010 --- /dev/null +++ b/examples/14-imports/output/rust/src/point.rs @@ -0,0 +1,8 @@ +// Generated by hobgoblin. + +/// A 2D point. +#[derive(Clone, Debug, Hash, PartialEq)] +pub struct Point { + pub x: ::core::primitive::i32, + pub y: ::core::primitive::i32, +} |
