diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/loops/dont-suggest-break-thru-item.rs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/ui/loops/dont-suggest-break-thru-item.rs b/tests/ui/loops/dont-suggest-break-thru-item.rs new file mode 100644 index 000000000..b46ba89e8 --- /dev/null +++ b/tests/ui/loops/dont-suggest-break-thru-item.rs @@ -0,0 +1,55 @@ +// edition:2021 + +#![feature(inline_const)] + +fn closure() { + loop { + let closure = || { + if true { + Err(1) + //~^ ERROR mismatched types + } + + Ok(()) + }; + } +} + +fn async_block() { + loop { + let fut = async { + if true { + Err(1) + //~^ ERROR mismatched types + } + + Ok(()) + }; + } +} + +fn fn_item() { + let _ = loop { + fn foo() -> Result<(), ()> { + if true { + Err(1) + //~^ ERROR mismatched types + } + Err(()) + } + }; +} + +fn const_block() { + let _ = loop { + const { + if true { + Err(1) + //~^ ERROR mismatched types + } + Err(()) + }; + }; +} + +fn main() {} |