2024-02-16 20:02:50 +00:00
|
|
|
//@ aux-build:coherence_orphan_lib.rs
|
2020-01-09 05:56:38 -05:00
|
|
|
#![feature(negative_impls)]
|
2015-01-13 20:21:19 +01:00
|
|
|
|
2015-03-19 15:39:03 -07:00
|
|
|
extern crate coherence_orphan_lib as lib;
|
2014-10-21 23:48:39 -04:00
|
|
|
|
|
|
|
|
use lib::TheTrait;
|
|
|
|
|
|
|
|
|
|
struct TheType;
|
|
|
|
|
|
2024-02-19 17:39:25 -03:00
|
|
|
impl TheTrait<usize> for isize {}
|
2025-02-28 01:28:32 +00:00
|
|
|
//~^ ERROR only traits defined in the current crate can be implemented for primitive types
|
2014-10-21 23:48:39 -04:00
|
|
|
|
2024-02-19 17:39:25 -03:00
|
|
|
impl TheTrait<TheType> for isize {}
|
2014-10-21 23:48:39 -04:00
|
|
|
|
2024-02-19 17:39:25 -03:00
|
|
|
impl TheTrait<isize> for TheType {}
|
2014-10-21 23:48:39 -04:00
|
|
|
|
2025-02-28 01:28:32 +00:00
|
|
|
impl !Send for Vec<isize> {}
|
|
|
|
|
//~^ ERROR only traits defined in the current crate can be implemented for types defined outside of the crate
|
2015-01-13 20:21:19 +01:00
|
|
|
|
2024-02-19 17:39:25 -03:00
|
|
|
fn main() {}
|