rust/src/test/ui/specialization/specialization-polarity.rs

18 lines
315 B
Rust
Raw Normal View History

2016-02-23 09:48:34 -06:00
// Make sure specialization cannot change impl polarity
#![feature(optin_builtin_traits)]
#![feature(negative_impls)]
#![feature(specialization)]
auto trait Foo {}
2016-02-23 09:48:34 -06:00
impl<T> Foo for T {}
2020-04-22 07:18:22 -05:00
impl !Foo for u8 {} //~ ERROR E0751
auto trait Bar {}
2016-02-23 09:48:34 -06:00
impl<T> !Bar for T {}
2020-04-22 07:18:22 -05:00
impl Bar for u8 {} //~ ERROR E0751
2016-02-23 09:48:34 -06:00
fn main() {}