Skip to content

How to use it with main.rs instead of lib.rs #364

Answered by kpcyrd
MathieuSoysal asked this question in Q&A
Discussion options

You must be logged in to vote

The way this works is, your fuzz/ subfolder has a dependency on your template_exercisme crate:

[dependencies.template_exercisme]
path = ".."

This fails because you're missing a src/lib.rs file, if you crate one with touch src/lib.rs you get a different error:

error[E0432]: unresolved import `template_exercisme::play_game`
 --> fuzz_targets/fuzz_play_game.rs:6:5
  |
6 | use template_exercisme::play_game;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `play_game` in the root

warning: unused `#[macro_use]` import
 --> fuzz_targets/fuzz_play_game.rs:4:1
  |
4 | #[macro_use] extern crate libfuzzer_sys;
  | ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

For more information abo…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by MathieuSoysal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants