Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/stack_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// ```
#[macro_export]
macro_rules! pin_mut {
($($x:ident),*) => { $(
($($x:ident),* $(,)?) => { $(
// Move the value to ensure that it is owned
let mut $x = $x;
// Shadow the original binding so that it can't be directly accessed
Expand Down
9 changes: 9 additions & 0 deletions tests/stack_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,13 @@ fn stack_pin() {
let foo = Foo {};
pin_mut!(foo);
let _: Pin<&mut Foo> = foo;

let bar = Foo {};
let baz = Foo {};
pin_mut!(
bar,
baz,
);
let _: Pin<&mut Foo> = bar;
let _: Pin<&mut Foo> = baz;
}