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
According to the manual, "an expression statement is one that evaluates an expression and ignores its result. The type of an expression statement e; is always ()"
However assignments of the form,
let x = {e;};
cause the compiler to crash. Likewise with struct field assignments,
S {x: {e;}};
Self-contained example program:
struct S {x:()}
fn main(){
// crashes the compiler
let s : S = S{x: {println!("a");} }; //
// crashes the compiler
let x : () = {println!("a");};
// note the following works
let y : int = {0};
// as does
let z : () = { {println!("a");} ; ()};
}
The text was updated successfully, but these errors were encountered:
…e, r=jonas-schievink
fix: handle raw identifiers in move_module_to_file
Fixesrust-lang#12045
Note that I special case'd mod named `r#mod` as commented in the code. Although it's very unlikely that one would use such name, I included it in this fix for the sake of completeness.
According to the manual, "an expression statement is one that evaluates an expression and ignores its result. The type of an expression statement e; is always ()"
However assignments of the form,
cause the compiler to crash. Likewise with struct field assignments,
Self-contained example program:
The text was updated successfully, but these errors were encountered: