aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaibo Huang <hhb@google.com>2020-09-16 01:06:31 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-09-16 01:06:31 +0000
commit26c3dd7d6a829c775cfd786bb667316749fdad1b (patch)
treed0ffc3e4bbc5b66ebb1b1a89bc43944f49dc7439
parent5b4f651e442663cead056956cd6cfa0f325490ef (diff)
parent2453d8f399414b8bac6530c34a320171ec32b95e (diff)
downloadpaste-26c3dd7d6a829c775cfd786bb667316749fdad1b.tar.gz
Upgrade rust/crates/paste to 1.0.1 am: f16e575bae am: 46d0e914f0 am: 13fe6d96b1 am: 2453d8f399
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/paste/+/1428032 Change-Id: I00549986108902a99890e02dcc3d8b2ad27bfe6c
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Cargo.toml3
-rw-r--r--Cargo.toml.orig3
-rw-r--r--METADATA8
-rw-r--r--tests/test_expr.rs36
5 files changed, 45 insertions, 7 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 9a7aced..18adbe1 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
{
"git": {
- "sha1": "949f5cc56255f400dfa6ffbe2a7d7e4fee7c6d92"
+ "sha1": "ead8998a76e6b28a0ade8574490e18f7bb52877b"
}
}
diff --git a/Cargo.toml b/Cargo.toml
index d4a5861..c86fc87 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,10 +13,11 @@
[package]
edition = "2018"
name = "paste"
-version = "1.0.0"
+version = "1.0.1"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Macros for all your token pasting needs"
readme = "README.md"
+categories = ["no-std"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/paste"
[package.metadata.docs.rs]
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 216c2f5..5365865 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -1,11 +1,12 @@
[package]
name = "paste"
-version = "1.0.0"
+version = "1.0.1"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2018"
license = "MIT OR Apache-2.0"
description = "Macros for all your token pasting needs"
repository = "https://github.com/dtolnay/paste"
+categories = ["no-std"]
readme = "README.md"
[lib]
diff --git a/METADATA b/METADATA
index dfeb92b..74b7e73 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/paste/paste-1.0.0.crate"
+ value: "https://static.crates.io/crates/paste/paste-1.0.1.crate"
}
- version: "1.0.0"
+ version: "1.0.1"
license_type: NOTICE
last_upgrade_date {
year: 2020
- month: 7
- day: 26
+ month: 9
+ day: 15
}
}
diff --git a/tests/test_expr.rs b/tests/test_expr.rs
index 8186a37..8c0cc28 100644
--- a/tests/test_expr.rs
+++ b/tests/test_expr.rs
@@ -199,3 +199,39 @@ mod test_x86_feature_literal {
my_is_x86_feature_detected!("mmx");
}
+
+#[rustversion::since(1.46)]
+mod test_local_setter {
+ // https://github.com/dtolnay/paste/issues/7
+
+ use paste::paste;
+
+ #[derive(Default)]
+ struct Test {
+ val: i32,
+ }
+
+ impl Test {
+ fn set_val(&mut self, arg: i32) {
+ self.val = arg;
+ }
+ }
+
+ macro_rules! setter {
+ ($obj:expr, $field:ident, $value:expr) => {
+ paste! { $obj.[<set_ $field>]($value); }
+ };
+
+ ($field:ident, $value:expr) => {{
+ let mut new = Test::default();
+ setter!(new, val, $value);
+ new
+ }};
+ }
+
+ #[test]
+ fn test_local_setter() {
+ let a = setter!(val, 42);
+ assert_eq!(a.val, 42);
+ }
+}