Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
30
tests/ui/return/return-impl-trait.fixed
Normal file
30
tests/ui/return/return-impl-trait.fixed
Normal file
|
@ -0,0 +1,30 @@
|
|||
// 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::<()>();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue