diff options
| author | Frank King <frankking1729@gmail.com> | 2025-01-19 22:01:11 +0800 |
|---|---|---|
| committer | Frank King <frankking1729@gmail.com> | 2025-06-15 10:21:29 +0800 |
| commit | e627f88f88de85cc52ff1c99a076909084806c98 (patch) | |
| tree | 0f53bd1e6bef6c79ada367f0a6ca8c7ac6eb2f93 /src/tools/rustfmt/tests/source/pin_sugar.rs | |
| parent | 49a8ba06848fa8f282fe9055b4178350970bb0ce (diff) | |
| download | rust-e627f88f88de85cc52ff1c99a076909084806c98.tar.gz rust-e627f88f88de85cc52ff1c99a076909084806c98.zip | |
Implement pinned borrows, part of `pin_ergonomics`
Diffstat (limited to 'src/tools/rustfmt/tests/source/pin_sugar.rs')
| -rw-r--r-- | src/tools/rustfmt/tests/source/pin_sugar.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/rustfmt/tests/source/pin_sugar.rs b/src/tools/rustfmt/tests/source/pin_sugar.rs index 370dfbc196a..e5b47339b92 100644 --- a/src/tools/rustfmt/tests/source/pin_sugar.rs +++ b/src/tools/rustfmt/tests/source/pin_sugar.rs @@ -18,3 +18,13 @@ impl Foo { mut self) {} fn i(&pin mut self) {} } + +fn borrows() { + let mut foo = 0_i32; + let x: Pin<&mut _> = & pin + mut foo; + + let x: Pin<&_> = & + pin const + foo; +} |
