mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
31 lines
426 B
Rust
31 lines
426 B
Rust
//@ run-rustfix
|
|
|
|
trait Trait {}
|
|
impl Trait for () {}
|
|
|
|
// this works
|
|
fn foo() -> impl Trait {
|
|
()
|
|
}
|
|
|
|
fn bar<T: Trait + std::marker::Sync>() -> impl Trait + std::marker::Sync + Send
|
|
where
|
|
T: Send,
|
|
{
|
|
() //~ ERROR mismatched types
|
|
}
|
|
|
|
fn other_bounds<T>() -> impl Trait
|
|
where
|
|
T: Trait,
|
|
Vec<usize>: Clone,
|
|
{
|
|
() //~ ERROR mismatched types
|
|
}
|
|
|
|
fn main() {
|
|
foo();
|
|
bar::<()>();
|
|
other_bounds::<()>();
|
|
}
|