diff options
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 7 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | Cargo.toml.orig | 4 | ||||
-rw-r--r-- | METADATA | 4 | ||||
-rw-r--r-- | tests/test.rs | 35 |
6 files changed, 48 insertions, 8 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 1347e27..40fcd29 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "157559c3faf524ae24f8329537d2a763f6e18931" + "sha1": "b5ce9a40b201ffe985e13260f6b0fa9ef5330fd7" } } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d4b341..b4476e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,13 +12,18 @@ jobs: strategy: fail-fast: false matrix: - rust: [nightly, beta, stable, 1.31.0] + rust: [nightly, beta, stable, 1.32.0] + include: + - rust: 1.31.0 + rustflags: --cfg no_literal_matcher steps: - uses: actions/checkout@v2 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} - run: cargo test + env: + RUSTFLAGS: ${{matrix.rustflags}} minimal: name: Minimal versions @@ -13,7 +13,7 @@ [package] edition = "2018" name = "paste" -version = "0.1.14" +version = "0.1.15" authors = ["David Tolnay <dtolnay@gmail.com>"] description = "Macros for all your token pasting needs" readme = "README.md" @@ -22,7 +22,7 @@ repository = "https://github.com/dtolnay/paste" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] [dependencies.paste-impl] -version = "=0.1.14" +version = "=0.1.15" [dependencies.proc-macro-hack] version = "0.5.9" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 2d4833f..28c943d 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "paste" -version = "0.1.14" +version = "0.1.15" authors = ["David Tolnay <dtolnay@gmail.com>"] edition = "2018" license = "MIT OR Apache-2.0" @@ -9,7 +9,7 @@ repository = "https://github.com/dtolnay/paste" readme = "README.md" [dependencies] -paste-impl = { version = "=0.1.14", path = "impl" } +paste-impl = { version = "=0.1.15", path = "impl" } proc-macro-hack = "0.5.9" [dev-dependencies] @@ -9,11 +9,11 @@ third_party { type: GIT value: "https://github.com/dtolnay/paste" } - version: "0.1.14" + version: "0.1.15" license_type: NOTICE last_upgrade_date { year: 2020 month: 5 - day: 25 + day: 29 } } diff --git a/tests/test.rs b/tests/test.rs index 8e6ea75..0a7cc76 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -364,3 +364,38 @@ mod test_type_in_path { let _ = get_b; } } + +mod test_pat_in_expr_position { + // https://github.com/xiph/rav1e/pull/2324/files + + macro_rules! rav1e_bad { + ($e:pat) => { + paste::item! { + #[test] + fn test() { + let _ = $e; + } + } + }; + } + + rav1e_bad!(std::fmt::Error); +} + +#[cfg(not(no_literal_matcher))] +mod test_x86_feature_literal { + // work around https://github.com/rust-lang/rust/issues/72726 + + macro_rules! my_is_x86_feature_detected { + ($feat:literal) => { + paste::item! { + #[test] + fn test() { + let _ = is_x86_feature_detected!($feat); + } + } + }; + } + + my_is_x86_feature_detected!("mmx"); +} |