Skip to content

Commit

Permalink
Cleanup fn trait ref test
Browse files Browse the repository at this point in the history
  • Loading branch information
onestacked committed Nov 9, 2022
1 parent f665847 commit b6c05eb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/test/ui/consts/fn_trait_refs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// build-pass
// check-pass

#![feature(const_fn_trait_ref_impls)]
#![feature(fn_traits)]
Expand Down Expand Up @@ -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));
};
}

0 comments on commit b6c05eb

Please sign in to comment.