rust/tests/ui/traits/const-traits/fn-ptr-lub.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
258 B
Rust
Raw Normal View History

2024-10-21 20:16:33 +00:00
//@ compile-flags: -Znext-solver
//@ check-pass
2024-10-30 18:03:44 +00:00
#![feature(const_trait_impl)]
2024-10-21 20:16:33 +00:00
const fn foo() {}
const fn bar() {}
fn baz() {}
const fn caller(branch: bool) {
let mut x = if branch {
foo
} else {
bar
};
x = baz;
}
fn main() {}