Skip to content

Remove purity-related unsafe blocks #5487

New issue

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

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

Already on GitHub? # to your account

Closed
ghost opened this issue Mar 22, 2013 · 0 comments
Closed

Remove purity-related unsafe blocks #5487

ghost opened this issue Mar 22, 2013 · 0 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.

Comments

@ghost
Copy link

ghost commented Mar 22, 2013

When pure is gone (#5384), the libraries should be reviewed for uses of unsafe that were only there for purity reasons. #1913 might make this easier.

One instance I just came across is in core::vec::map.

bors added a commit that referenced this issue Apr 15, 2013
Closes #5487, #1913, and #4568

I tracked this by adding all used unsafe blocks/functions to a set on the `tcx` passed around, and then when the lint pass comes around if an unsafe block/function isn't listed in that set, it's unused.

I also removed everything from the compiler that was unused, and up to stage2 is now compiling without any known unused unsafe blocks.

I chose `unused_unsafe` as the name of the lint attribute, but there may be a better name...
@sanxiyn sanxiyn closed this as completed Apr 16, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Nov 20, 2020
Check when `from_utf8` is called from sliced byte array from string

---

*Please keep the line below*
changelog: Fix rust-lang#5487: Add linter to check when `from_utf8` is called from sliced byte array from string.
calebcartwright added a commit to calebcartwright/rust that referenced this issue Jan 24, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup.
Projects
None yet
Development

No branches or pull requests

1 participant