rust/tests/ui/traits/safety-trait-impl-cc.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
322 B
Rust
Raw Normal View History

// aux-build:trait_safety_lib.rs
// Check that unsafe traits require unsafe impls and that inherent
// impls cannot be unsafe.
extern crate trait_safety_lib as lib;
struct Bar;
impl lib::Foo for Bar { //~ ERROR requires an `unsafe impl` declaration
fn foo(&self) -> isize {
2015-12-11 07:59:11 +00:00
panic!();
}
}
fn main() { }