Skip to content

Commit 7c711f0

Browse files
committed
Enable testing of documentation examples
1 parent c239f03 commit 7c711f0

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

Cargo.toml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ option, off by default, to also reimplement itself in terms of the upstream
1515
unstable API.
1616
"""
1717

18-
[lib]
19-
doctest = false
20-
2118
[package.metadata.docs.rs]
2219
rustc-args = ["--cfg", "procmacro2_semver_exempt"]
2320
rustdoc-args = ["--cfg", "procmacro2_semver_exempt"]
2421

2522
[dependencies]
2623
unicode-xid = "0.1"
2724

25+
[dev-dependencies]
26+
quote = "0.6"
27+
2828
[features]
2929
# When enabled: act as a shim around the nightly compiler's proc_macro crate.
3030
# This requires a nightly compiler.
@@ -38,3 +38,11 @@ default = ["proc-macro"]
3838

3939
[badges]
4040
travis-ci = { repository = "alexcrichton/proc-macro2" }
41+
42+
[patch.crates-io]
43+
# Our doc tests depend on quote which depends on proc-macro2. Without this line,
44+
# the proc-macro2 dependency of quote would be the released version of
45+
# proc-macro2. Quote would implement its traits for types from that proc-macro2,
46+
# meaning impls would be missing when tested against types from the local
47+
# proc-macro2.
48+
proc-macro2 = { path = "." }

0 commit comments

Comments
 (0)