Add regression tests
This commit is contained in:
parent
12d3f107c1
commit
c227d85021
2 changed files with 24 additions and 0 deletions
10
src/test/ui/type-alias-impl-trait/cross_inference.rs
Normal file
10
src/test/ui/type-alias-impl-trait/cross_inference.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
// check-pass
|
||||
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
fn main() {
|
||||
type T = impl Copy;
|
||||
let foo: T = (1u32, 2u32);
|
||||
let x: (_, _) = foo;
|
||||
println!("{:?}", x);
|
||||
}
|
14
src/test/ui/type-alias-impl-trait/cross_inference_rpit.rs
Normal file
14
src/test/ui/type-alias-impl-trait/cross_inference_rpit.rs
Normal file
|
@ -0,0 +1,14 @@
|
|||
// check-pass
|
||||
|
||||
fn foo(b: bool) -> impl Copy {
|
||||
if b {
|
||||
return (5,6)
|
||||
}
|
||||
let x: (_, _) = foo(true);
|
||||
println!("{:?}", x);
|
||||
(1u32, 2u32)
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo(false);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue