Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added unstable-book entry for bindings_after_at
- Loading branch information
1 parent
595088d
commit ef65e09
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/doc/unstable-book/src/language-features/bindings-after-at.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# `bindings_after_at` | ||
|
||
The tracking issue for this feature is [#65490] | ||
|
||
[#65490]: https://github.com/rust-lang/rust/issues/65490 | ||
|
||
|
||
The `bindings_after_at` feature gate allows patterns of form `binding @ pat` to have bindings in `pat`. | ||
|
||
```rust | ||
#![feature(bindings_after_at)] | ||
|
||
struct Point { | ||
x: i32, | ||
y: i32, | ||
} | ||
|
||
fn main() { | ||
let point@ Point{x: px, y: py} = Point {x: 12, y: 34}; | ||
} | ||
``` | ||
|