diff options
author | Joel Galenson <jgalenson@google.com> | 2021-08-13 02:37:19 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-13 02:37:19 +0000 |
commit | 506543cf88d7e93289aa3ba399eca47b2934d848 (patch) | |
tree | c0991738aeea4e139664a11059108d30bbfd3458 | |
parent | 27cad0a9bc466c0ae9e4c44f560a24462c417d72 (diff) | |
parent | 35062ef8f23d5d8f4ce89b06a44ec8a24b33dbc0 (diff) | |
download | proc-macro2-506543cf88d7e93289aa3ba399eca47b2934d848.tar.gz |
Upgrade rust/crates/proc-macro2 to 1.0.28 am: 35062ef8f2
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/proc-macro2/+/1791035
Change-Id: I8c7101e251eccef0cf634ab51da21d3c38d84950
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 14 | ||||
-rw-r--r-- | Cargo.toml | 11 | ||||
-rw-r--r-- | Cargo.toml.orig | 2 | ||||
-rw-r--r-- | METADATA | 8 | ||||
-rw-r--r-- | build.rs | 37 | ||||
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/parse.rs | 2 |
8 files changed, 48 insertions, 30 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 409e220..0b4ad97 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "2517d6283f4e6a308519881bf7222f60c785626d" + "sha1": "93c4df24e2d5ef9ddff484a7086f2e0018a13507" } } @@ -91,7 +91,7 @@ rust_test_host { } rust_defaults { - name: "proc-macro2_defaults", + name: "proc-macro2_test_defaults", crate_name: "proc_macro2", test_suites: ["general-tests"], auto_gen_config: true, @@ -118,7 +118,7 @@ rust_defaults { rust_test_host { name: "proc-macro2_host_test_tests_comments", - defaults: ["proc-macro2_defaults"], + defaults: ["proc-macro2_test_defaults"], srcs: ["tests/comments.rs"], test_options: { unit_test: true, @@ -127,7 +127,7 @@ rust_test_host { rust_test_host { name: "proc-macro2_host_test_tests_features", - defaults: ["proc-macro2_defaults"], + defaults: ["proc-macro2_test_defaults"], srcs: ["tests/features.rs"], test_options: { unit_test: true, @@ -136,7 +136,7 @@ rust_test_host { rust_test_host { name: "proc-macro2_host_test_tests_marker", - defaults: ["proc-macro2_defaults"], + defaults: ["proc-macro2_test_defaults"], srcs: ["tests/marker.rs"], test_options: { unit_test: true, @@ -145,7 +145,7 @@ rust_test_host { rust_test_host { name: "proc-macro2_host_test_tests_test", - defaults: ["proc-macro2_defaults"], + defaults: ["proc-macro2_test_defaults"], srcs: ["tests/test.rs"], test_options: { unit_test: true, @@ -154,7 +154,7 @@ rust_test_host { rust_test_host { name: "proc-macro2_host_test_tests_test_fmt", - defaults: ["proc-macro2_defaults"], + defaults: ["proc-macro2_test_defaults"], srcs: ["tests/test_fmt.rs"], test_options: { unit_test: true, @@ -162,6 +162,6 @@ rust_test_host { } // dependent_library ["feature_list"] -// proc-macro2-1.0.27 +// proc-macro2-1.0.28 // quote-1.0.9 // unicode-xid-0.2.2 "default" @@ -3,17 +3,16 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "proc-macro2" -version = "1.0.27" +version = "1.0.28" authors = ["Alex Crichton <alex@alexcrichton.com>", "David Tolnay <dtolnay@gmail.com>"] description = "A substitute implementation of the compiler's `proc_macro` API to decouple\ntoken-based libraries from the procedural macro use case.\n" documentation = "https://docs.rs/proc-macro2" diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 324c33c..254063e 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "proc-macro2" -version = "1.0.27" # remember to update html_root_url +version = "1.0.28" # remember to update html_root_url authors = ["Alex Crichton <alex@alexcrichton.com>", "David Tolnay <dtolnay@gmail.com>"] license = "MIT OR Apache-2.0" readme = "README.md" @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.27.crate" + value: "https://static.crates.io/crates/proc-macro2/proc-macro2-1.0.28.crate" } - version: "1.0.27" + version: "1.0.28" license_type: NOTICE last_upgrade_date { year: 2021 - month: 6 - day: 21 + month: 8 + day: 9 } } @@ -35,6 +35,7 @@ // location inside spans is a performance hit. use std::env; +use std::iter; use std::process::{self, Command}; use std::str; @@ -132,15 +133,33 @@ fn feature_allowed(feature: &str) -> bool { // // -Zallow-features=feature1,feature2 - if let Some(rustflags) = env::var_os("RUSTFLAGS") { - for mut flag in rustflags.to_string_lossy().split(' ') { - if flag.starts_with("-Z") { - flag = &flag["-Z".len()..]; - } - if flag.starts_with("allow-features=") { - flag = &flag["allow-features=".len()..]; - return flag.split(',').any(|allowed| allowed == feature); - } + let flags_var; + let flags_var_string; + let mut flags_var_split; + let mut flags_none; + let flags: &mut dyn Iterator<Item = &str> = + if let Some(encoded_rustflags) = env::var_os("CARGO_ENCODED_RUSTFLAGS") { + flags_var = encoded_rustflags; + flags_var_string = flags_var.to_string_lossy(); + flags_var_split = flags_var_string.split('\x1f'); + &mut flags_var_split + } else if let Some(rustflags) = env::var_os("RUSTFLAGS") { + flags_var = rustflags; + flags_var_string = flags_var.to_string_lossy(); + flags_var_split = flags_var_string.split(' '); + &mut flags_var_split + } else { + flags_none = iter::empty(); + &mut flags_none + }; + + for mut flag in flags { + if flag.starts_with("-Z") { + flag = &flag["-Z".len()..]; + } + if flag.starts_with("allow-features=") { + flag = &flag["allow-features=".len()..]; + return flag.split(',').any(|allowed| allowed == feature); } } @@ -78,7 +78,7 @@ //! a different thread. // Proc-macro2 types in rustdoc of other crates get linked to here. -#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.27")] +#![doc(html_root_url = "https://docs.rs/proc-macro2/1.0.28")] #![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] #![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))] #![cfg_attr(doc_cfg, feature(doc_cfg))] diff --git a/src/parse.rs b/src/parse.rs index 13a05a8..eddb490 100644 --- a/src/parse.rs +++ b/src/parse.rs @@ -461,7 +461,7 @@ fn cooked_byte_string(mut input: Cursor) -> Result<Cursor, Reject> { fn raw_string(input: Cursor) -> Result<Cursor, Reject> { let mut chars = input.char_indices(); let mut n = 0; - while let Some((i, ch)) = chars.next() { + for (i, ch) in &mut chars { match ch { '"' => { n = i; |