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

Fix ICE when calling static and static mut function pointers #8594

Closed
wants to merge 4 commits into from
Closed

Fix ICE when calling static and static mut function pointers #8594

wants to merge 4 commits into from

Conversation

bytwise
Copy link
Contributor

@bytwise bytwise commented Aug 18, 2013

Fixes #8588

@alexcrichton
Copy link
Member

Looks good to me, but could you also add a test exercising this functionality in a cross-crate situation? I just want to make sure that you can assign to statics from other crates, you can call statics from other crates, and nothing dies immediately.

@Aatch
Copy link
Contributor

Aatch commented Aug 18, 2013

Nice work, thanks for this.

@brendanzab
Copy link
Member

Thankyou!

@bytwise
Copy link
Contributor Author

bytwise commented Aug 21, 2013

I updated the test case to skip the cross-crate test on check-fast. That should fix the failure on the windows bot.

static F: extern fn(int) -> int = f;
static mut G: extern fn(int) -> int = f;

fn main() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think for windows this also needs to be pub fn main

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

bors added a commit that referenced this pull request Aug 21, 2013
@bors bors closed this Aug 22, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Apr 7, 2022
…raffate

add `empty_structs_with_brackets`

<!-- Thank you for making Clippy better!

We're collecting our changelog from pull request descriptions.
If your PR only includes internal changes, you can just write
`changelog: none`. Otherwise, please write a short comment
explaining your change. Also, it's helpful for us that
the lint name is put into brackets `[]` and backticks `` ` ` ``,
e.g. ``[`lint_name`]``.

If your PR fixes an issue, you can add "fixes #issue_number" into this
PR description. This way the issue will be automatically closed when
your PR is merged.

If you added a new lint, here's a checklist for things that will be
checked during review or continuous integration.

- \[ ] Followed [lint naming conventions][lint_naming]
- \[ ] Added passing UI tests (including committed `.stderr` file)
- \[ ] `cargo test` passes locally
- \[ ] Executed `cargo dev update_lints`
- \[ ] Added lint documentation
- \[ ] Run `cargo dev fmt`

[lint_naming]: https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints

Note that you can skip the above if you are just opening a WIP PR in
order to get feedback.

Delete this line and everything above before opening your PR.

--

*Please write a short comment explaining your change (or "none" for internal only changes)*
-->
Closes rust-lang#8591

I'm already sorry for the massive diff 😅

changelog: New lint [`empty_structs_with_brackets`]
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

Successfully merging this pull request may close these issues.

ICE when calling static and static mut function pointers.
5 participants