Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shadowing by temporary variable #960

Open
arnaudgolfouse opened this issue Mar 1, 2024 · 1 comment
Open

Shadowing by temporary variable #960

arnaudgolfouse opened this issue Mar 1, 2024 · 1 comment

Comments

@arnaudgolfouse
Copy link
Collaborator

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.

@xldenis
Copy link
Collaborator

xldenis commented Mar 1, 2024

I didn't even know you could have that kind of variable in rust

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants