# Name elision

**URL:** <https://internals.rust-lang.org/t/name-elision/14141>\
**Category:** language design\
**Created:** [February 28, 2021, 6:04pm UTC](https://internals.rust-lang.org/t/name-elision/14141 "2021-02-28T18:04:20Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [March 2, 2021, 1:01am UTC](https://internals.rust-lang.org/t/name-elision/14141/14 "2021-03-02T01:01:51Z")

</div>

> [@Aloso](#):
>
> Or just in function arguments?

Function arguments are just irrefutable patterns, so they shouldn't be special -- if it works in a function argument it should work in other pattern positions too.

Personally I'd say definitely to braced-struct patterns and braced-struct literals.

Tuple structs I don't really know, because in expressions they're just function calls ([RFC#1506](https://rust-lang.github.io/rfcs/1506-adt-kinds.html)), so the parallel to "well there are lots of places where `_` mean to infer the type" isn't so good. As a workaround one could just do `foo(a, b, ☃ { 0: c, 1: d });`, but that also makes me think that part of the goodness of this syntax is the expectation that the field names are what makes this readable in the first place, and maybe it would be good for `foo(a, b, ☃(c, d));` to not work, since it feels like maybe it should have just taken a normal tuple at that point. At least it seems like enough justification that it could be left out of an MVP -- maybe later we'd go "oops, should have included that", but we can find out over time.

That also brings up the related feature for enums, like being able to `☃::V4(v4) => v4.is_link_local(),` in a `match`:

- [Short enum variant syntax in some cases](https://internals.rust-lang.org/t/short-enum-variant-syntax-in-some-cases/13113)
- [Elliding type in matching an Enum](https://internals.rust-lang.org/t/elliding-type-in-matching-an-enum/4935)
- [Idea: reducing boilerplate in APIs that use ADTs](https://internals.rust-lang.org/t/idea-reducing-boilerplate-in-apis-that-use-adts/4889)
- [Bring enum variants in scope for patterns](https://internals.rust-lang.org/t/bring-enum-variants-in-scope-for-patterns/12104)

---

_[View the full topic](https://internals.rust-lang.org/t/name-elision/14141)._
