]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/never_type/diverging-fallback-control-flow.rs
4 #![allow(unused_assignments)]
5 #![allow(unused_variables)]
6 #![allow(unreachable_code)]
8 // Test various cases where we permit an unconstrained variable
9 // to fallback based on control-flow.
11 // These represent current behavior, but are pretty dubious. I would
12 // like to revisit these and potentially change them. --nmatsakis
14 #![feature(never_type, never_type_fallback)]
20 impl BadDefault
for u32 {
21 fn default() -> Self {
26 impl BadDefault
for ! {
36 x
= BadDefault
::default();
48 x
= BadDefault
::default();
60 fn if_then_else_rev() {
69 let _x
= match Ok(BadDefault
::default()) {
76 let _x
= match Ok(BadDefault
::default()) {
87 break BadDefault
::default();
97 break BadDefault
::default();