diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/typeck/typeck_type_placeholder_item.rs (renamed from src/test/ui/typeck/typeck_type_placeholder_item.rs) | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/ui/typeck/typeck_type_placeholder_item.rs b/tests/ui/typeck/typeck_type_placeholder_item.rs index 22fedb22d..b96c52713 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_item.rs +++ b/tests/ui/typeck/typeck_type_placeholder_item.rs @@ -220,3 +220,11 @@ fn value() -> Option<&'static _> { const _: Option<_> = map(value); //~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants + +fn evens_squared(n: usize) -> _ { +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types + (1..n).filter(|x| x % 2 == 0).map(|x| x * x) +} + +const _: _ = (1..10).filter(|x| x % 2 == 0).map(|x| x * x); +//~^ ERROR the placeholder `_` is not allowed within types on item signatures for constants |