rust/tests/ui/transmutability/malformed-program-gracefulness/coherence-bikeshed-intrinsic-from.rs

12 lines
413 B
Rust
Raw Normal View History

2024-04-21 14:01:04 -05:00
#![feature(transmutability)]
#![feature(type_alias_impl_trait)]
trait OpaqueTrait {}
type OpaqueType = impl OpaqueTrait;
2024-09-21 02:04:42 -05:00
//~^ ERROR unconstrained opaque type
2024-04-21 14:01:04 -05:00
trait AnotherTrait {}
impl<T: std::mem::TransmuteFrom<(), ()>> AnotherTrait for T {}
2024-09-21 02:04:42 -05:00
//~^ ERROR type provided when a constant was expected
2024-04-21 14:01:04 -05:00
impl AnotherTrait for OpaqueType {}
2024-09-21 02:04:42 -05:00
//~^ ERROR conflicting implementations of trait `AnotherTrait`
2024-04-21 14:01:04 -05:00
pub fn main() {}