2015-01-27 01:07:31 +01:00
|
|
|
#![feature(optin_builtin_traits)]
|
|
|
|
|
2017-12-03 10:56:53 -02:00
|
|
|
auto trait MySafeTrait {}
|
2015-01-27 01:07:31 +01:00
|
|
|
|
2017-12-03 10:56:53 -02:00
|
|
|
struct Foo;
|
2015-03-11 18:53:55 -05:00
|
|
|
|
2017-12-03 10:56:53 -02:00
|
|
|
unsafe impl MySafeTrait for Foo {}
|
2015-03-11 18:53:55 -05:00
|
|
|
//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
|
|
|
|
|
2017-12-03 10:56:53 -02:00
|
|
|
unsafe auto trait MyUnsafeTrait {}
|
2015-03-11 18:53:55 -05:00
|
|
|
|
2017-12-03 10:56:53 -02:00
|
|
|
impl MyUnsafeTrait for Foo {}
|
2015-03-11 18:53:55 -05:00
|
|
|
//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
|
|
|
|
|
2015-01-27 01:07:31 +01:00
|
|
|
fn main() {}
|