diff options
| author | onestacked <chrisi.schrefl@gmail.com> | 2022-11-09 11:35:28 +0100 |
|---|---|---|
| committer | onestacked <chrisi.schrefl@gmail.com> | 2022-11-09 11:35:28 +0100 |
| commit | b6c05eb7d3f59b43b2e9ada520167f87bb4084aa (patch) | |
| tree | d15838a74d1e81eb73fd9de867c665daf4199b17 | |
| parent | f6658479a83bae99c097031ea0e1e74e6e836c1e (diff) | |
| download | rust-b6c05eb7d3f59b43b2e9ada520167f87bb4084aa.tar.gz rust-b6c05eb7d3f59b43b2e9ada520167f87bb4084aa.zip | |
Cleanup fn trait ref test
| -rw-r--r-- | src/test/ui/consts/fn_trait_refs.rs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/test/ui/consts/fn_trait_refs.rs b/src/test/ui/consts/fn_trait_refs.rs index bc8766c74c6..b507492970a 100644 --- a/src/test/ui/consts/fn_trait_refs.rs +++ b/src/test/ui/consts/fn_trait_refs.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass #![feature(const_fn_trait_ref_impls)] #![feature(fn_traits)] @@ -60,21 +60,18 @@ const fn test(i: i32) -> i32 { i + 1 } -const fn main() { +fn main() { const fn one() -> i32 { 1 }; const fn two() -> i32 { 2 }; + const _: () = { + let test_one = test_fn(one); + assert!(test_one == (1, 1, 1)); - // FIXME(const_cmp_tuple) - let test_one = test_fn(one); - assert!(test_one.0 == 1); - assert!(test_one.1 == 1); - assert!(test_one.2 == 1); - - let test_two = test_fn_mut(two); - assert!(test_two.0 == 1); - assert!(test_two.1 == 1); + let test_two = test_fn_mut(two); + assert!(test_two == (2, 2)); + }; } |
