You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expression loop {break} has type (), as it must. However, within a second loop labeled 'outer, the expression loop {break 'outer} should have type !, not (). Note that break 'outer and even loop {loop {break 'outer}} are already correctly typed as !.
Example with incorrect type error:
fnfoo(){'outer:loop{let a :i32;
a = break'outer // ok}}fnbar(){'outer:loop{let a :i32;
a = loop{break'outer}// error: mismatched types: expected i32, found ()}}fnbaz(){'outer:loop{let a :i32;
a = loop{loop{break'outer}}// ok}}
I’m using rustc 1.0.0-dev (built 2015-03-17) from ppa:hansjorg/rust.
The text was updated successfully, but these errors were encountered:
The expression
loop {break}
has type()
, as it must. However, within a second loop labeled'outer
, the expressionloop {break 'outer}
should have type!
, not()
. Note thatbreak 'outer
and evenloop {loop {break 'outer}}
are already correctly typed as!
.Example with incorrect type error:
I’m using rustc 1.0.0-dev (built 2015-03-17) from ppa:hansjorg/rust.
The text was updated successfully, but these errors were encountered: