Skip to content

Commit

Permalink
Merge pull request #430 from dtolnay/nightlyci
Browse files Browse the repository at this point in the history
Make CI verify that proc_macro_span works in latest nightly
  • Loading branch information
dtolnay authored Dec 31, 2023
2 parents 643cb89 + 75897cf commit df4fa83
Show file tree
Hide file tree
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
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down

0 comments on commit df4fa83

Please sign in to comment.