mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
15 lines
255 B
Rust
15 lines
255 B
Rust
mod cat {
|
|
pub struct Cat {
|
|
meows: usize
|
|
}
|
|
|
|
pub fn new_cat() -> Cat {
|
|
Cat { meows: 52 }
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let nyan = cat::new_cat();
|
|
assert_eq!(nyan.meows, 52); //~ ERROR field `meows` of struct `Cat` is private
|
|
}
|