diff options
Diffstat (limited to 'tests/project_if_attr.rs.in')
-rw-r--r-- | tests/project_if_attr.rs.in | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/tests/project_if_attr.rs.in b/tests/project_if_attr.rs.in deleted file mode 100644 index 7bc236d..0000000 --- a/tests/project_if_attr.rs.in +++ /dev/null @@ -1,45 +0,0 @@ -#[test] -#[project] -fn project_if_let() { - #[pin_project] - enum Foo<A, B> { - Variant1(#[pin] A), - Variant2(u8), - Variant3 { - #[pin] - field: B, - }, - } - - let mut x: Foo<bool, f32> = Foo::Variant1(true); - let x = Pin::new(&mut x).project(); - - #[project] - if let Foo::Variant1(a) = x { - let a: Pin<&mut bool> = a; - assert_eq!(*a, true); - } else if let Foo::Variant2(_) = x { - unreachable!(); - } else if let Foo::Variant3 { .. } = x { - unreachable!(); - } -} - -#[allow(clippy::unnecessary_operation, clippy::unit_arg)] -#[test] -#[project] -fn non_stmt_expr_if_let() { - #[pin_project] - enum Enum<A> { - Variant(#[pin] A), - } - - let mut x = Enum::Variant(1); - let x = Pin::new(&mut x).project(); - - #[allow(irrefutable_let_patterns)] - Some( - #[project] - if let Enum::Variant(_x) = x {}, - ); -} |