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

Don't cast HANDLE to usize and back #635

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

CraftSpider
Copy link
Contributor

Not sure if there's interest for this one - I'm aware of argument whether HANDLE really needs to be a pointer, and it's defined as isize for non-std mode bindgen, but it was an easy change so I figured I'd put it up for review.

Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

weird, code that treats pointers as pointers instead of a funny integer is actually simpler than code that treats it as a funny integer!

@ChrisDenton
Copy link
Member

The trouble there was using two or three different definitions of HANDLE in the same code. I can only assume it was written before we had AtomicPtr otherwise I don't understand why that wasn't used in the first place.

@workingjubilee workingjubilee merged commit dcd0aaa into rust-lang:master Jul 5, 2024
41 checks passed
ConradIrwin pushed a commit to zed-industries/zed that referenced this pull request Sep 19, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [backtrace](https://redirect.github.com/rust-lang/backtrace-rs) |
dependencies | patch | `0.3.73` -> `0.3.74` |
| [backtrace](https://redirect.github.com/rust-lang/backtrace-rs) |
dev-dependencies | patch | `0.3.73` -> `0.3.74` |

---

### Release Notes

<details>
<summary>rust-lang/backtrace-rs (backtrace)</summary>

###
[`v0.3.74`](https://redirect.github.com/rust-lang/backtrace-rs/releases/tag/0.3.74)

[Compare
Source](https://redirect.github.com/rust-lang/backtrace-rs/compare/0.3.73...0.3.74)

#### What's Changed

- QNX Neutrino 7.0 support, thanks to
[@&#8203;nyurik](https://redirect.github.com/nyurik) in
[rust-lang/backtrace-rs#648
- Cleaned up our Android support. This should massively improve
backtraces for ones with the API level sufficient to ship with
libunwind, etc. Unfortunately, it comes at the cost of dropping support
for older ones! Thanks to
[@&#8203;fengys](https://redirect.github.com/fengys) in
[rust-lang/backtrace-rs#656
- Made PrintFmt, which was using the `Enum::__NonExhaustiveVariant`
pattern, use `#[non_exhaustive]` for real. Don't @&#8203; me if you were
matching on that! Thanks to
[@&#8203;nyurik](https://redirect.github.com/nyurik) in
[rust-lang/backtrace-rs#651
- Massively cleaned up the windows code! We moved from winapi to
windows-sys with windows-targets thanks to
[@&#8203;CraftSpider](https://redirect.github.com/CraftSpider) and
[@&#8203;ChrisDenton](https://redirect.github.com/ChrisDenton) in
- Don't cast HANDLE to usize and back by
[@&#8203;CraftSpider](https://redirect.github.com/CraftSpider) in
[rust-lang/backtrace-rs#635
- Switch from `winapi` to `windows-sys` by
[@&#8203;CraftSpider](https://redirect.github.com/CraftSpider) in
[rust-lang/backtrace-rs#641
- Update windows bindings and use windows-targets by
[@&#8203;ChrisDenton](https://redirect.github.com/ChrisDenton) in
[rust-lang/backtrace-rs#653
- A bunch of updated dependencies. Thanks
[@&#8203;djc](https://redirect.github.com/djc) and
[@&#8203;khuey](https://redirect.github.com/khuey)!
- Sorry if you were testing this code in miri! It started yelling about
sussy casts. A lot. We did a bunch of internal cleanups that should make
it quiet down, thanks to
[@&#8203;workingjubilee](https://redirect.github.com/workingjubilee) in
[rust-lang/backtrace-rs#641
- Uhhh we had to tweak `dl_iterate_phdr` in
[rust-lang/backtrace-rs#660
after Android revealed it was... kind of unsound actually and not doing
things like checking for null pointers before making slices! WHOOPS!
Thanks to [@&#8203;saethlin](https://redirect.github.com/saethlin) for
implementing detection for precisely that in rustc! It's really hard to
find soundness issues in inherited codebases like this one...

#### New Contributors

- [@&#8203;CraftSpider](https://redirect.github.com/CraftSpider) made
their first contribution in
[rust-lang/backtrace-rs#635
- [@&#8203;fengys1996](https://redirect.github.com/fengys1996) made
their first contribution in
[rust-lang/backtrace-rs#656
- [@&#8203;djc](https://redirect.github.com/djc) made their first
contribution in
[rust-lang/backtrace-rs#657

**Full Changelog**:
rust-lang/backtrace-rs@0.3.73...0.3.74

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants