diff options
Diffstat (limited to 'tests/ui/impl-trait/nesting.rs')
-rw-r--r-- | tests/ui/impl-trait/nesting.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/nesting.rs b/tests/ui/impl-trait/nesting.rs new file mode 100644 index 000000000..27bdd5fa4 --- /dev/null +++ b/tests/ui/impl-trait/nesting.rs @@ -0,0 +1,15 @@ +// run-pass +#![allow(dead_code)] + +fn foo<T>(t: T) -> impl Into<[T; { const FOO: usize = 1; FOO }]> { + [t] +} + +fn bar() -> impl Into<[u8; { const FOO: usize = 1; FOO }]> { + [99] +} + +fn main() { + println!("{:?}", foo(42).into()); + println!("{:?}", bar().into()); +} |