Closed
Description
example, foo.rs
:
#![crate_type = "lib"]
mod inner {
pub struct Foo {
pub field: i32
}
}
pub fn foo() -> inner::Foo {
inner::Foo { field: 42 }
}
bar.rs
:
extern crate foo;
fn main() {
let f = foo::foo();
drop(f);
println!("{}", f.field);
}
foo
compiles cleanly, bar
doesn't compile because oh no! I've forgotten to make foo::inner::Foo
Copy
able.