mirror of
https://github.com/Noratrieb/fuzz-rustc-ast.git
synced 2026-01-16 12:05:02 +01:00
setup
This commit is contained in:
parent
667902b059
commit
869329c430
3 changed files with 59 additions and 3 deletions
45
Cargo.lock
generated
45
Cargo.lock
generated
|
|
@ -2,6 +2,51 @@
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arbitrary"
|
||||||
|
version = "1.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c38b6b6b79f671c25e1a3e785b7b82d7562ffc9cd3efdc98627e5668a2472490"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fuzz-rustc-ast"
|
name = "fuzz-rustc-ast"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"arbitrary",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "proc-macro2"
|
||||||
|
version = "1.0.36"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-xid",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "quote"
|
||||||
|
version = "1.0.15"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "syn"
|
||||||
|
version = "1.0.88"
|
||||||
|
source = "git+https://github.com/Nilstrieb/syn?branch=arbitrary#a0860e2ae754ade1340683bc54e403540202484b"
|
||||||
|
dependencies = [
|
||||||
|
"arbitrary",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"unicode-xid",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-xid"
|
||||||
|
version = "0.2.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,9 @@ name = "fuzz-rustc-ast"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
arbitrary = "1.1.0"
|
||||||
|
# fork of syn with the arbitrary trait impls
|
||||||
|
syn = { git = "https://github.com/Nilstrieb/syn", branch = "arbitrary", features = ["full", "arbitrary"] }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
|
|
||||||
10
src/main.rs
10
src/main.rs
|
|
@ -1,3 +1,11 @@
|
||||||
|
use arbitrary::Arbitrary;
|
||||||
|
use std::path::PathBuf;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
let data = std::fs::read(PathBuf::from(file!()).parent().unwrap().join("Cargo.toml")).unwrap();
|
||||||
|
let mut unstructured = arbitrary::Unstructured::new(&data);
|
||||||
|
|
||||||
|
let ast = syn::Item::arbitrary(&mut unstructured);
|
||||||
|
|
||||||
|
println!("{ast}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue