rust/src/test/ui/coherence/coherence-impls-sized.rs

37 lines
686 B
Rust
Raw Normal View History

#![feature(optin_builtin_traits)]
use std::marker::Copy;
enum TestE {
A
}
struct MyType;
struct NotSync;
impl !Sync for NotSync {}
impl Sized for TestE {} //~ ERROR E0322
2016-08-14 13:57:33 -05:00
//~^ impl of 'Sized' not allowed
impl Sized for MyType {} //~ ERROR E0322
2016-08-14 13:57:33 -05:00
//~^ impl of 'Sized' not allowed
impl Sized for (MyType, MyType) {} //~ ERROR E0322
//~^ impl of 'Sized' not allowed
//~| ERROR E0117
impl Sized for &'static NotSync {} //~ ERROR E0322
2016-08-14 13:57:33 -05:00
//~^ impl of 'Sized' not allowed
impl Sized for [MyType] {} //~ ERROR E0322
//~^ impl of 'Sized' not allowed
//~| ERROR E0117
impl Sized for &'static [NotSync] {} //~ ERROR E0322
//~^ impl of 'Sized' not allowed
//~| ERROR E0117
fn main() {
}