2015-03-19 17:39:03 -05:00
|
|
|
// aux-build:trait_safety_lib.rs
|
2014-12-10 16:24:10 -06:00
|
|
|
|
|
|
|
// Check that unsafe traits require unsafe impls and that inherent
|
|
|
|
// impls cannot be unsafe.
|
|
|
|
|
2015-03-19 17:39:03 -05:00
|
|
|
extern crate trait_safety_lib as lib;
|
2014-12-10 16:24:10 -06:00
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
impl lib::Foo for Bar { //~ ERROR requires an `unsafe impl` declaration
|
2015-01-08 04:54:35 -06:00
|
|
|
fn foo(&self) -> isize {
|
2015-12-11 01:59:11 -06:00
|
|
|
panic!();
|
2014-12-10 16:24:10 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|