creusot
creusot copied to clipboard
Shadowing by temporary variable
The following:
pub fn testing(x: i32) {
let _3 = 1;
testing(x);
}
produces (approx):
module Test_Testing
use prelude.Int32
use prelude.Int
let rec cfg testing (x : int32) : ()
=
var _0 : ();
var x : int32 = x;
var _3 : ();
{
goto BB0
}
BB0 {
_3 <- ( (1 : int32));
_3 <- ( testing ( x));
goto BB1
}
BB1 {
_0 <- ( ());
return _0
}
end
The variable _3
is shadowed by a temporary.
I didn't even know you could have that kind of variable in rust