Skip to content

Commit

Permalink
Merge pull request #52 from anderejd/identify_forbid_unsafe
Browse files Browse the repository at this point in the history
Identify #![forbid(unsafe_code)]
  • Loading branch information
anderejd authored Feb 20, 2019
2 parents 0d6a6a7 + ebcd80f commit 14b6539
Show file tree
Hide file tree
Showing 5 changed files with 320 additions and 87 deletions.
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cargo-geiger ☢
cargo-geiger ☢
===============

A program that list statistics related to usage of unsafe Rust code in a Rust
Expand Down Expand Up @@ -48,27 +48,40 @@ inevitable in some situations and both should preferably be safely contained!
Known issues
------------

- Unsafe code inside macros are not detected. Needs macro expansion(?).
- Unsafe code generated by `build.rs` are probably not detected.
- Will continue on syn parse errors. Should default to exit on the first error(?).
- More on the github issue tracker.
- Unsafe code inside macros are not detected. Needs macro expansion(?).
- Unsafe code generated by `build.rs` are probably not detected.
- More on the github issue tracker.


Roadmap
-------

- There should be no false negatives. All unsafe code should be identified.
- An optional whitelist file at the root crate level to specify crates that are
trusted to use unsafe (should only have an effect if placed in the root
project).
- Refactoring and general cleanup.
- Replace all remaining panics with Result based errors handling.
- Additional output formats.
- ~~There should be no false negatives. All unsafe code should be
identified.~~ This is probably too ambitious, but scanning for
`#![forbid(unsafe_code)]` should be a reliable alternative (implemented since
0.6.0). Please see the changelog.
- An optional whitelist file at the root crate level to specify crates that are
trusted to use unsafe (should only have an effect if placed in the root
project).
- Needs more refactoring.
- All panics should be replaced with Result based errors handling.
- Additional output formats.


Changelog
---------

### 0.6.0 (unreleased)
- There are now three crate scanning result variants:
- 🔒 No unsafe usage found and all build target entry point `.rs` source
files, used by the build, declare `#![forbid(unsafe_code)]`. Crates like
this will be printed in green.
- ❓ No unsafe usage found, but at least one build target entry pount `.rs`
file, used by the build, does not declare `#[forbid(unsafe_code)]`. Crates
like this will be printed in the default terminal forground color.
- ☢️ Unsafe usage found. Crates like this will be printed in red, same as in
the previous version.

### 0.5.0
- Moved resusable parts, decoupled from `cargo`, to the new crate
[geiger][geiger]. Main github issue: [#30].
Expand Down
Loading

0 comments on commit 14b6539

Please sign in to comment.