rust/src/test/compile-fail/xc-private-method.rs

17 lines
658 B
Rust
Raw Normal View History

// xfail-fast
// aux-build:xc_private_method_lib.rs
extern mod xc_private_method_lib;
fn main() {
2013-08-07 12:29:29 +00:00
// normal method on struct
let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); //~ ERROR method `meth_struct` is private
// static method on struct
let _ = xc_private_method_lib::Struct::static_meth_struct(); //~ ERROR method `static_meth_struct` is private
2013-08-07 12:29:29 +00:00
// normal method on enum
let _ = xc_private_method_lib::Variant1(20).meth_enum(); //~ ERROR method `meth_enum` is private
// static method on enum
let _ = xc_private_method_lib::Enum::static_meth_enum(); //~ ERROR method `static_meth_enum` is private
}