summaryrefslogtreecommitdiffstats
path: root/vendor/quote
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:24 +0000
commit023939b627b7dc93b01471f7d41fb8553ddb4ffa (patch)
tree60fc59477c605c72b0a1051409062ddecc43f877 /vendor/quote
parentAdding debian version 1.72.1+dfsg1-1. (diff)
downloadrustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.tar.xz
rustc-023939b627b7dc93b01471f7d41fb8553ddb4ffa.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/quote')
-rw-r--r--vendor/quote/.cargo-checksum.json2
-rw-r--r--vendor/quote/Cargo.toml7
-rw-r--r--vendor/quote/README.md14
-rw-r--r--vendor/quote/build.rs38
-rw-r--r--vendor/quote/src/ident_fragment.rs6
-rw-r--r--vendor/quote/src/lib.rs4
-rw-r--r--vendor/quote/src/runtime.rs8
-rw-r--r--vendor/quote/src/spanned.rs12
-rw-r--r--vendor/quote/src/to_tokens.rs4
-rw-r--r--vendor/quote/tests/ui/not-quotable.stderr18
10 files changed, 39 insertions, 74 deletions
diff --git a/vendor/quote/.cargo-checksum.json b/vendor/quote/.cargo-checksum.json
index 777d2370d..1b936035b 100644
--- a/vendor/quote/.cargo-checksum.json
+++ b/vendor/quote/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"59a2c8d6c9bbf664015750f61f7f1e6a1397f1e5e3b679e941d920ebe23ada56","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"15d3ee300a69f4eec5f81b74fce4652fa22ce84d44413379bc756e4aaca23300","build.rs":"3733c86ae2733629f873f93c2f45da30164beee8de9ee0833099fac6a05a3e6b","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/ext.rs":"9881576cac3e476a4bf04f9b601cf9a53b79399fb0ca9634e8b861ac91709843","src/format.rs":"c595015418f35e6992e710441b9999f09b2afe4678b138039d670d100c0bdd86","src/ident_fragment.rs":"6b3b6621cd20bae776d2455f2b05f04433d8ce617c113e83a3683edef0667d1f","src/lib.rs":"1cb40e47755849e7ada55cbe7b29cef8d9d0d66f948d0cd5acac3aa4481d5a60","src/runtime.rs":"31b2159986c68dc1c78801a92f795435dbc0bcea859ca342df280889e82c6c4d","src/spanned.rs":"0ccaae1137af5f3e54eae75c3bdc637be74cfa56a857f2c0f85a041c9ba26838","src/to_tokens.rs":"99bb6f467289c32af6c1f7af0d45cc6ac7b31e2436774e616770152a49e6ac0f","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test.rs":"3be80741f84a707376c230d9cf70ce9537caa359691d8d4c34968e28175e4ad7","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated-dup.stderr":"90a4bdb9267535f5d2785940148338d6b7d905548051d2c9c5dcbd58f2c11d8e","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-interpolated.stderr":"ae7c2739554c862b331705e82781aa4687a4375210cef6ae899a4be4a4ec2d97","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter-separated.stderr":"03fd560979ebcd5aa6f83858bc2c3c01ba6546c16335101275505304895c1ae9","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/does-not-have-iter.stderr":"d6da483c29e232ced72059bbdf05d31afb1df9e02954edaa9cfaea1ec6df72dc","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-quotable.stderr":"efcace9419fdf64d6beca7e135c3b7daff74038d4449475896cbe8cbf2566ade","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/not-repeatable.stderr":"594249d59d16f039c16816f1aaf9933176994e296fcf81d1b8b24d5b66ae0d0a","tests/ui/wrong-type-span.rs":"6195e35ea844c0c52ba1cff5d790c3a371af6915d137d377834ad984229ef9ea","tests/ui/wrong-type-span.stderr":"cad072e40e0ecc04f375122ae41aede2f0da2a9244492b3fcf70249e59d1b128"},"package":"573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105"} \ No newline at end of file
+{"files":{"Cargo.toml":"1281fc9e2d2585993462d6ba4b8f256670f6323e2d534779834b5a5d0628bae4","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"626e7079eab0baacf0fcaf3e244f407b2014ebaeca45905d72e8fb8bed18aaea","rust-toolchain.toml":"6bbb61302978c736b2da03e4fb40e3beab908f85d533ab46fd541e637b5f3e0f","src/ext.rs":"9881576cac3e476a4bf04f9b601cf9a53b79399fb0ca9634e8b861ac91709843","src/format.rs":"c595015418f35e6992e710441b9999f09b2afe4678b138039d670d100c0bdd86","src/ident_fragment.rs":"0b3e6c2129e55910fd2d240e1e7efba6f1796801d24352d1c0bfbceb0e8b678f","src/lib.rs":"6c86107389b1c975d3e5566182206b5c12653dcc16a2c7d1d5b28ce59eb9b4b6","src/runtime.rs":"34b6fe7543a742f4be5d6d13ed51e99e32e68f3c809d1aebb8b2c020984cb819","src/spanned.rs":"3ccf5120593f35787442c0a37d243e802c5262e7f8b35aed503873008ec035c5","src/to_tokens.rs":"1c76311fcc82098e630056d71fd6f3929194ee31b0840e2aa643ed7e78026e3e","tests/compiletest.rs":"022a8e400ef813d7ea1875b944549cee5125f6a995dc33e93b48cba3e1b57bd1","tests/test.rs":"3be80741f84a707376c230d9cf70ce9537caa359691d8d4c34968e28175e4ad7","tests/ui/does-not-have-iter-interpolated-dup.rs":"ad13eea21d4cdd2ab6c082f633392e1ff20fb0d1af5f2177041e0bf7f30da695","tests/ui/does-not-have-iter-interpolated-dup.stderr":"90a4bdb9267535f5d2785940148338d6b7d905548051d2c9c5dcbd58f2c11d8e","tests/ui/does-not-have-iter-interpolated.rs":"83a5b3f240651adcbe4b6e51076d76d653ad439b37442cf4054f1fd3c073f3b7","tests/ui/does-not-have-iter-interpolated.stderr":"ae7c2739554c862b331705e82781aa4687a4375210cef6ae899a4be4a4ec2d97","tests/ui/does-not-have-iter-separated.rs":"fe413c48331d5e3a7ae5fef6a5892a90c72f610d54595879eb49d0a94154ba3f","tests/ui/does-not-have-iter-separated.stderr":"03fd560979ebcd5aa6f83858bc2c3c01ba6546c16335101275505304895c1ae9","tests/ui/does-not-have-iter.rs":"09dc9499d861b63cebb0848b855b78e2dc9497bfde37ba6339f3625ae009a62f","tests/ui/does-not-have-iter.stderr":"d6da483c29e232ced72059bbdf05d31afb1df9e02954edaa9cfaea1ec6df72dc","tests/ui/not-quotable.rs":"5759d0884943417609f28faadc70254a3e2fd3d9bd6ff7297a3fb70a77fafd8a","tests/ui/not-quotable.stderr":"459bdadbf1e73b9401cf7d5d578dc053774bb4e5aa25ad2abf25d6b0f61aa306","tests/ui/not-repeatable.rs":"a4b115c04e4e41049a05f5b69450503fbffeba031218b4189cb931839f7f9a9c","tests/ui/not-repeatable.stderr":"594249d59d16f039c16816f1aaf9933176994e296fcf81d1b8b24d5b66ae0d0a","tests/ui/wrong-type-span.rs":"6195e35ea844c0c52ba1cff5d790c3a371af6915d137d377834ad984229ef9ea","tests/ui/wrong-type-span.stderr":"cad072e40e0ecc04f375122ae41aede2f0da2a9244492b3fcf70249e59d1b128"},"package":"50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965"} \ No newline at end of file
diff --git a/vendor/quote/Cargo.toml b/vendor/quote/Cargo.toml
index af2ffc42b..2899cb1bb 100644
--- a/vendor/quote/Cargo.toml
+++ b/vendor/quote/Cargo.toml
@@ -11,9 +11,9 @@
[package]
edition = "2018"
-rust-version = "1.31"
+rust-version = "1.56"
name = "quote"
-version = "1.0.29"
+version = "1.0.32"
authors = ["David Tolnay <dtolnay@gmail.com>"]
autobenches = false
description = "Quasi-quoting macro quote!(...)"
@@ -28,13 +28,14 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/quote"
[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
targets = ["x86_64-unknown-linux-gnu"]
[lib]
doc-scrape-examples = false
[dependencies.proc-macro2]
-version = "1.0.63"
+version = "1.0.66"
default-features = false
[dev-dependencies.rustversion]
diff --git a/vendor/quote/README.md b/vendor/quote/README.md
index 4d1a97381..bfc91a975 100644
--- a/vendor/quote/README.md
+++ b/vendor/quote/README.md
@@ -34,7 +34,7 @@ macros.
quote = "1.0"
```
-*Version requirement: Quote supports rustc 1.31 and up.*<br>
+*Version requirement: Quote supports rustc 1.56 and up.*<br>
[*Release notes*](https://github.com/dtolnay/quote/releases)
<br>
@@ -240,6 +240,18 @@ convenient for a human to read and debug.
Be aware that no kind of hygiene or span information is retained when tokens are
written to a file; the conversion from tokens to source code is lossy.
+Example usage in build.rs:
+
+```rust
+let output = quote! { ... };
+let syntax_tree = syn::parse2(output).unwrap();
+let formatted = prettyplease::unparse(&syntax_tree);
+
+let out_dir = env::var_os("OUT_DIR").unwrap();
+let dest_path = Path::new(&out_dir).join("out.rs");
+fs::write(dest_path, formatted).unwrap();
+```
+
[prettyplease]: https://github.com/dtolnay/prettyplease
<br>
diff --git a/vendor/quote/build.rs b/vendor/quote/build.rs
deleted file mode 100644
index a7e6b2cda..000000000
--- a/vendor/quote/build.rs
+++ /dev/null
@@ -1,38 +0,0 @@
-use std::env;
-use std::process::{self, Command};
-use std::str;
-
-fn main() {
- println!("cargo:rerun-if-changed=build.rs");
-
- let version = match rustc_version() {
- Some(version) => version,
- None => return,
- };
-
- if version.minor < 31 {
- eprintln!("Minimum supported rustc version is 1.31");
- process::exit(1);
- }
-
- if version.minor < 53 {
- // https://github.com/rust-lang/rust/issues/43081
- println!("cargo:rustc-cfg=needs_invalid_span_workaround");
- }
-}
-
-struct RustcVersion {
- minor: u32,
-}
-
-fn rustc_version() -> Option<RustcVersion> {
- let rustc = env::var_os("RUSTC")?;
- let output = Command::new(rustc).arg("--version").output().ok()?;
- let version = str::from_utf8(&output.stdout).ok()?;
- let mut pieces = version.split('.');
- if pieces.next() != Some("rustc 1") {
- return None;
- }
- let minor = pieces.next()?.parse().ok()?;
- Some(RustcVersion { minor })
-}
diff --git a/vendor/quote/src/ident_fragment.rs b/vendor/quote/src/ident_fragment.rs
index e7e8a3d94..6c2a9a87a 100644
--- a/vendor/quote/src/ident_fragment.rs
+++ b/vendor/quote/src/ident_fragment.rs
@@ -1,6 +1,6 @@
+use alloc::borrow::Cow;
use core::fmt;
use proc_macro2::{Ident, Span};
-use std::borrow::Cow;
/// Specialized formatting trait used by `format_ident!`.
///
@@ -49,8 +49,8 @@ impl IdentFragment for Ident {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let id = self.to_string();
- if id.starts_with("r#") {
- fmt::Display::fmt(&id[2..], f)
+ if let Some(id) = id.strip_prefix("r#") {
+ fmt::Display::fmt(id, f)
} else {
fmt::Display::fmt(&id[..], f)
}
diff --git a/vendor/quote/src/lib.rs b/vendor/quote/src/lib.rs
index d871fb080..1cd7cd626 100644
--- a/vendor/quote/src/lib.rs
+++ b/vendor/quote/src/lib.rs
@@ -92,7 +92,7 @@
//! [prettyplease]: https://github.com/dtolnay/prettyplease
// Quote types in rustdoc of other crates get linked to here.
-#![doc(html_root_url = "https://docs.rs/quote/1.0.29")]
+#![doc(html_root_url = "https://docs.rs/quote/1.0.32")]
#![allow(
clippy::doc_markdown,
clippy::missing_errors_doc,
@@ -102,6 +102,8 @@
clippy::wrong_self_convention,
)]
+extern crate alloc;
+
#[cfg(feature = "proc-macro")]
extern crate proc_macro;
diff --git a/vendor/quote/src/runtime.rs b/vendor/quote/src/runtime.rs
index 4e3d4fd03..ce893ebec 100644
--- a/vendor/quote/src/runtime.rs
+++ b/vendor/quote/src/runtime.rs
@@ -5,9 +5,9 @@ use core::iter;
use core::ops::BitOr;
use proc_macro2::{Group, Ident, Punct, Spacing, TokenTree};
+pub use alloc::format;
pub use core::option::Option;
pub use proc_macro2::{Delimiter, Span, TokenStream};
-pub use std::format;
pub struct HasIterator; // True
pub struct ThereIsNoIteratorInRepetition; // False
@@ -50,8 +50,8 @@ pub mod ext {
use super::RepInterp;
use super::{HasIterator as HasIter, ThereIsNoIteratorInRepetition as DoesNotHaveIter};
use crate::ToTokens;
+ use alloc::collections::btree_set::{self, BTreeSet};
use core::slice;
- use std::collections::btree_set::{self, BTreeSet};
/// Extension trait providing the `quote_into_iter` method on iterators.
pub trait RepIteratorExt: Iterator + Sized {
@@ -443,8 +443,8 @@ pub fn mk_ident(id: &str, span: Option<Span>) -> Ident {
}
fn ident_maybe_raw(id: &str, span: Span) -> Ident {
- if id.starts_with("r#") {
- Ident::new_raw(&id[2..], span)
+ if let Some(id) = id.strip_prefix("r#") {
+ Ident::new_raw(id, span)
} else {
Ident::new(id, span)
}
diff --git a/vendor/quote/src/spanned.rs b/vendor/quote/src/spanned.rs
index efc2e8bce..6eba64445 100644
--- a/vendor/quote/src/spanned.rs
+++ b/vendor/quote/src/spanned.rs
@@ -26,20 +26,8 @@ impl<T: ?Sized + ToTokens> Spanned for T {
}
fn join_spans(tokens: TokenStream) -> Span {
- #[cfg(not(needs_invalid_span_workaround))]
let mut iter = tokens.into_iter().map(|tt| tt.span());
- #[cfg(needs_invalid_span_workaround)]
- let mut iter = tokens.into_iter().filter_map(|tt| {
- let span = tt.span();
- let debug = format!("{:?}", span);
- if debug.ends_with("bytes(0..0)") {
- None
- } else {
- Some(span)
- }
- });
-
let first = match iter.next() {
Some(span) => span,
None => return Span::call_site(),
diff --git a/vendor/quote/src/to_tokens.rs b/vendor/quote/src/to_tokens.rs
index 57487217e..23b6ec2c0 100644
--- a/vendor/quote/src/to_tokens.rs
+++ b/vendor/quote/src/to_tokens.rs
@@ -1,8 +1,8 @@
use super::TokenStreamExt;
+use alloc::borrow::Cow;
+use alloc::rc::Rc;
use core::iter;
use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree};
-use std::borrow::Cow;
-use std::rc::Rc;
/// Types that can be interpolated inside a `quote!` invocation.
///
diff --git a/vendor/quote/tests/ui/not-quotable.stderr b/vendor/quote/tests/ui/not-quotable.stderr
index 79d46548d..35cb6f2b1 100644
--- a/vendor/quote/tests/ui/not-quotable.stderr
+++ b/vendor/quote/tests/ui/not-quotable.stderr
@@ -8,13 +8,13 @@ error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied
| required by a bound introduced by this call
|
= help: the following other types implement trait `ToTokens`:
- &'a T
- &'a mut T
- Box<T>
- Cow<'a, T>
- Option<T>
- Rc<T>
- RepInterp<T>
- String
- and 23 others
+ bool
+ char
+ isize
+ i8
+ i16
+ i32
+ i64
+ i128
+ and $N others
= note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)