Skip to content

Commit

Permalink
Make CI verify that proc_macro_span works in latest nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Dec 31, 2023
1 parent 643cb89 commit 75897cf
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -57,6 +57,9 @@ jobs:
components: rust-src
- name: Enable type layout randomization
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
- run: cargo check
env:
RUSTFLAGS: --cfg procmacro2_nightly_testing ${{env.RUSTFLAGS}}
- run: cargo test
- run: cargo test --no-default-features
- run: cargo test --no-default-features --test features -- --ignored make_sure_no_proc_macro # run the ignored test to make sure the `proc-macro` feature is disabled
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -122,6 +122,15 @@ compile_error! {"\
build script as well.
"}

#[cfg(all(
procmacro2_nightly_testing,
feature = "proc-macro",
not(proc_macro_span)
))]
compile_error! {"\
Build script probe failed to compile.
"}

extern crate alloc;

#[cfg(feature = "proc-macro")]

0 comments on commit 75897cf

Please sign in to comment.