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

Closed
arnaudgolfouse opened this issue Mar 1, 2024 · 2 comments
Closed

Shadowing by temporary variable #960

arnaudgolfouse opened this issue Mar 1, 2024 · 2 comments
Labels
bug Something isn't working

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

@xldenis xldenis added the bug Something isn't working label Sep 11, 2024
@Lysxia
Copy link
Collaborator

Lysxia commented Nov 25, 2024

Moving this to issue #1239

@Lysxia Lysxia closed this as completed Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants