Auto merge of #3423 - RalfJung:proc-macro-2, r=RalfJung

test-cargo-miri: add proc-macro2

This is already in the dependency tree of `serde_derive`, but I guess there is is a host dependency, here it is a target dependency.

The logic is presumably the same as in anyhow, so we don't need both; let's test the one that is more widely used.
This commit is contained in:
bors 2024-03-26 18:03:27 +00:00
commit 58a771ebfa
7 changed files with 37 additions and 67 deletions

View File

@ -2,17 +2,11 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "anyhow"
version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.1.0" version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
@ -22,34 +16,33 @@ checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855"
[[package]] [[package]]
name = "byteorder" name = "byteorder"
version = "1.4.3" version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]] [[package]]
name = "cargo-miri-test" name = "cargo-miri-test"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow",
"autocfg", "autocfg",
"byteorder 0.5.3", "byteorder 0.5.3",
"byteorder 1.4.3", "byteorder 1.5.0",
"cdylib", "cdylib",
"exported_symbol", "exported_symbol",
"eyre", "eyre",
"issue_1567", "issue_1567",
"issue_1691", "issue_1691",
"issue_1705", "issue_1705",
"issue_1760",
"issue_rust_86261", "issue_rust_86261",
"serde_derive", "proc-macro2",
"proc_macro_crate",
] ]
[[package]] [[package]]
name = "cdylib" name = "cdylib"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.4.3", "byteorder 1.5.0",
] ]
[[package]] [[package]]
@ -83,7 +76,7 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
name = "issue_1567" name = "issue_1567"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.4.3", "byteorder 1.5.0",
] ]
[[package]] [[package]]
@ -94,13 +87,9 @@ version = "0.1.0"
name = "issue_1705" name = "issue_1705"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.4.3", "byteorder 1.5.0",
] ]
[[package]]
name = "issue_1760"
version = "0.1.0"
[[package]] [[package]]
name = "issue_rust_86261" name = "issue_rust_86261"
version = "0.1.0" version = "0.1.0"
@ -113,53 +102,29 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.66" version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]] [[package]]
name = "quote" name = "proc_macro_crate"
version = "1.0.33" version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]]
name = "serde_derive"
version = "1.0.185"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc59dfdcbad1437773485e0367fea4b090a2e0a16d9ffc46af47764536a298ec"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "subcrate" name = "subcrate"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"byteorder 1.4.3", "byteorder 1.5.0",
]
[[package]]
name = "syn"
version = "2.0.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
] ]
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
version = "1.0.6" version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"

View File

@ -12,20 +12,20 @@ edition = "2018"
byteorder = "1.0" byteorder = "1.0"
cdylib = { path = "cdylib" } cdylib = { path = "cdylib" }
exported_symbol = { path = "exported-symbol" } exported_symbol = { path = "exported-symbol" }
proc_macro_crate = { path = "proc-macro-crate" }
issue_1567 = { path = "issue-1567" } issue_1567 = { path = "issue-1567" }
issue_1691 = { path = "issue-1691" } issue_1691 = { path = "issue-1691" }
issue_1705 = { path = "issue-1705" } issue_1705 = { path = "issue-1705" }
issue_1760 = { path = "issue-1760" }
issue_rust_86261 = { path = "issue-rust-86261" } issue_rust_86261 = { path = "issue-rust-86261" }
[dev-dependencies] [dev-dependencies]
byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming
# Not actually used, but exercises some unique code path (`--extern` .so file). ## More dependencies that we don't actually use, but add just for extra test coverage.
serde_derive = "1.0.185" # These use custom build probes, let's make sure they don't explode.
# Not actually used, but uses a custom build probe so let's make sure that works.
# (Ideally we'd check if the probe was successful, but that's not easily possible.) # (Ideally we'd check if the probe was successful, but that's not easily possible.)
anyhow = "1.0" # proc-macro2 is extra exciting because it is both a host-dependency (of proc_macro_crate above)
# Same as anyhow. # and a target-dependency.
proc-macro2 = "1.0"
eyre = "0.6" eyre = "0.6"
[build-dependencies] [build-dependencies]

View File

@ -1,8 +0,0 @@
[package]
name = "issue_1760"
version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"
[lib]
proc-macro = true

View File

@ -0,0 +1,13 @@
[package]
# regression test for issue 1760
name = "proc_macro_crate"
version = "0.1.0"
authors = ["Miri Team"]
edition = "2018"
[lib]
proc-macro = true
[dependencies]
# A common dependency of proc macros, let's make sure that works.
proc-macro2 = "1.0"

View File

@ -28,9 +28,9 @@
/// ``` /// ```
#[no_mangle] #[no_mangle]
pub fn make_true() -> bool { pub fn make_true() -> bool {
proc_macro_crate::use_the_dependency!();
issue_1567::use_the_dependency(); issue_1567::use_the_dependency();
issue_1705::use_the_dependency(); issue_1705::use_the_dependency();
issue_1760::use_the_dependency!();
issue_1691::use_me() issue_1691::use_me()
} }