mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
22 lines
658 B
Rust
22 lines
658 B
Rust
//@ compile-flags: -Znext-solver
|
|
|
|
#![feature(negative_bounds, negative_impls)]
|
|
|
|
trait Trait {}
|
|
impl !Trait for () {}
|
|
|
|
fn produce() -> impl !Trait {}
|
|
fn consume(_: impl Trait) {}
|
|
|
|
fn main() {
|
|
consume(produce()); //~ ERROR the trait bound `impl !Trait: Trait` is not satisfied
|
|
}
|
|
|
|
fn weird0() -> impl Sized + !Sized {}
|
|
//~^ ERROR type mismatch resolving `impl !Sized + Sized == ()`
|
|
fn weird1() -> impl !Sized + Sized {}
|
|
//~^ ERROR type mismatch resolving `impl !Sized + Sized == ()`
|
|
fn weird2() -> impl !Sized {}
|
|
//~^ ERROR type mismatch resolving `impl !Sized == ()`
|
|
//~| ERROR the size for values of type `impl !Sized` cannot be known at compilation time
|