File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,9 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
84
84
///
85
85
/// ```no_run
86
86
/// #![no_main]
87
+ /// # mod foo {
87
88
///
88
- /// use libfuzzer_sys::{arbitrary::{Arbitrary, Unstructured}, fuzz_target};
89
+ /// use libfuzzer_sys::{arbitrary::{Arbitrary, Error, Unstructured}, fuzz_target};
89
90
///
90
91
/// #[derive(Debug)]
91
92
/// pub struct Rgb {
@@ -94,11 +95,8 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
94
95
/// b: u8,
95
96
/// }
96
97
///
97
- /// impl Arbitrary for Rgb {
98
- /// fn arbitrary<U>(raw: &mut U) -> Result<Self, U::Error>
99
- /// where
100
- /// U: Unstructured + ?Sized
101
- /// {
98
+ /// impl<'a> Arbitrary<'a> for Rgb {
99
+ /// fn arbitrary(raw: &mut Unstructured<'a>) -> Result<Self, Error> {
102
100
/// let mut buf = [0; 3];
103
101
/// raw.fill_buffer(&mut buf)?;
104
102
/// let r = buf[0];
@@ -112,7 +110,12 @@ pub fn initialize(_argc: *const isize, _argv: *const *const *const u8) -> isize
112
110
/// fuzz_target!(|color: Rgb| {
113
111
/// my_crate::convert_color(color);
114
112
/// });
115
- /// # mod my_crate { fn convert_color(_: super::Rgb) {} }
113
+ /// # mod my_crate {
114
+ /// # use super::Rgb;
115
+ /// # pub fn convert_color(_: Rgb) {}
116
+ /// # }
117
+ /// # }
118
+ /// ```
116
119
#[ macro_export]
117
120
macro_rules! fuzz_target {
118
121
( |$bytes: ident| $body: block) => {
You can’t perform that action at this time.
0 commit comments