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

Field shorthand overwritten in promote local to const assist #15597

Merged
merged 1 commit into from Sep 16, 2023

Conversation

rmehri01
Copy link
Contributor

Currently, running promote_local_to_const on the following:

struct Foo {
    bar: usize,
}

fn main() {
    let $0bar = 0;
    let foo = Foo { bar };
}

Results in:

struct Foo {
    bar: usize,
}

fn main() {
    const BAR: usize = 0;
    let foo = Foo { BAR };
}

But instead should be something like:

struct Foo {
    bar: usize,
}

fn main() {
    const BAR: usize = 0;
    let foo = Foo { bar: BAR };
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 11, 2023
@HKalbasi
Copy link
Member

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Sep 16, 2023

📌 Commit cd0a89a has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 16, 2023

⌛ Testing commit cd0a89a with merge 9d0ccf0...

@bors
Copy link
Collaborator

bors commented Sep 16, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing 9d0ccf0 to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Sep 16, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing 9d0ccf0 to master...

@bors bors merged commit 9d0ccf0 into rust-lang:master Sep 16, 2023
10 checks passed
@bors
Copy link
Collaborator

bors commented Sep 16, 2023

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

@rmehri01 rmehri01 deleted the fix_promote_local_field_shorthand branch October 2, 2023 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants