]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/control-flow/short-circuit-let.rs
1 // `&&` and `||` were previously forbidden in constants alongside let bindings.
5 #![feature(const_panic)]
9 let _
= true && { x = 1; false }
;
14 let x
= true && false || true;
18 const fn truthy() -> bool
{
19 let x
= true || return false;
23 const fn falsy() -> bool
{
24 let x
= true && return false;
29 const _
: () = assert
!(Y
);
32 const _
: () = assert
!(X
== 1);
35 const _
: () = assert
!(truthy());
36 const _
: () = assert
!(!falsy());
37 assert
!(truthy() && !falsy());