chore: checkpoint before Python removal

This commit is contained in:
2026-03-26 22:33:59 +00:00
parent 683cec9307
commit e568ddf82a
29972 changed files with 11269302 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
use quote::quote;
fn main() {
let nonrep = "";
// Without some protection against repetitions with no iterator somewhere
// inside, this would loop infinitely.
quote!(#(#nonrep #nonrep)*);
}

View File

@@ -0,0 +1,13 @@
error[E0277]: repetition contains no interpolated value that is an iterator
--> tests/ui/does-not-have-iter-interpolated-dup.rs:8:5
|
8 | quote!(#(#nonrep #nonrep)*);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ none of the values interpolated inside this repetition are iterable
|
help: the trait `quote::__private::CheckHasIterator<true>` is not implemented for `quote::__private::HasIterator<false>`
but it is implemented for `quote::__private::HasIterator<true>`
--> src/runtime.rs
|
| impl CheckHasIterator<true> for HasIterator<true> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,9 @@
use quote::quote;
fn main() {
let nonrep = "";
// Without some protection against repetitions with no iterator somewhere
// inside, this would loop infinitely.
quote!(#(#nonrep)*);
}

View File

@@ -0,0 +1,13 @@
error[E0277]: repetition contains no interpolated value that is an iterator
--> tests/ui/does-not-have-iter-interpolated.rs:8:5
|
8 | quote!(#(#nonrep)*);
| ^^^^^^^^^^^^^^^^^^^ none of the values interpolated inside this repetition are iterable
|
help: the trait `quote::__private::CheckHasIterator<true>` is not implemented for `quote::__private::HasIterator<false>`
but it is implemented for `quote::__private::HasIterator<true>`
--> src/runtime.rs
|
| impl CheckHasIterator<true> for HasIterator<true> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,5 @@
use quote::quote;
fn main() {
quote!(#(a b),*);
}

View File

@@ -0,0 +1,13 @@
error[E0277]: repetition contains no interpolated value that is an iterator
--> tests/ui/does-not-have-iter-separated.rs:4:5
|
4 | quote!(#(a b),*);
| ^^^^^^^^^^^^^^^^ none of the values interpolated inside this repetition are iterable
|
help: the trait `quote::__private::CheckHasIterator<true>` is not implemented for `quote::__private::HasIterator<false>`
but it is implemented for `quote::__private::HasIterator<true>`
--> src/runtime.rs
|
| impl CheckHasIterator<true> for HasIterator<true> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,5 @@
use quote::quote;
fn main() {
quote!(#(a b)*);
}

View File

@@ -0,0 +1,13 @@
error[E0277]: repetition contains no interpolated value that is an iterator
--> tests/ui/does-not-have-iter.rs:4:5
|
4 | quote!(#(a b)*);
| ^^^^^^^^^^^^^^^ none of the values interpolated inside this repetition are iterable
|
help: the trait `quote::__private::CheckHasIterator<true>` is not implemented for `quote::__private::HasIterator<false>`
but it is implemented for `quote::__private::HasIterator<true>`
--> src/runtime.rs
|
| impl CheckHasIterator<true> for HasIterator<true> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

7
vendor/quote/tests/ui/not-quotable.rs vendored Normal file
View File

@@ -0,0 +1,7 @@
use quote::quote;
use std::net::Ipv4Addr;
fn main() {
let ip = Ipv4Addr::LOCALHOST;
let _ = quote! { #ip };
}

View File

@@ -0,0 +1,20 @@
error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied
--> tests/ui/not-quotable.rs:6:13
|
6 | let _ = quote! { #ip };
| ^^^^^^^^^^^^^^
| |
| the trait `ToTokens` is not implemented for `Ipv4Addr`
| required by a bound introduced by this call
|
= help: the following other types implement trait `ToTokens`:
&T
&mut T
Arc<T>
Box<T>
CStr
CString
Cow<'a, T>
Option<T>
and $N others
= note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,8 @@
use quote::quote;
struct Ipv4Addr;
fn main() {
let ip = Ipv4Addr;
let _ = quote! { #(#ip)* };
}

View File

@@ -0,0 +1,34 @@
error[E0599]: the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied
--> tests/ui/not-repeatable.rs:7:13
|
3 | struct Ipv4Addr;
| --------------- method `quote_into_iter` not found for this struct because `Ipv4Addr` doesn't implement `Iterator` or `ToTokens`
...
7 | let _ = quote! { #(#ip)* };
| ^^^^^^^^^^^^^^^^^^ method cannot be called on `Ipv4Addr` due to unsatisfied trait bounds
|
= note: the following trait bounds were not satisfied:
`Ipv4Addr: Iterator`
which is required by `Ipv4Addr: quote::__private::ext::RepIteratorExt`
`&Ipv4Addr: Iterator`
which is required by `&Ipv4Addr: quote::__private::ext::RepIteratorExt`
`Ipv4Addr: ToTokens`
which is required by `Ipv4Addr: quote::__private::ext::RepToTokensExt`
`&mut Ipv4Addr: Iterator`
which is required by `&mut Ipv4Addr: quote::__private::ext::RepIteratorExt`
note: the traits `Iterator` and `ToTokens` must be implemented
--> $RUST/core/src/iter/traits/iterator.rs
|
| pub const trait Iterator {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
::: src/to_tokens.rs
|
| pub trait ToTokens {
| ^^^^^^^^^^^^^^^^^^
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following traits define an item `quote_into_iter`, perhaps you need to implement one of them:
candidate #1: `quote::__private::ext::RepAsIteratorExt`
candidate #2: `quote::__private::ext::RepIteratorExt`
candidate #3: `quote::__private::ext::RepToTokensExt`
= note: this error originates in the macro `$crate::quote_bind_into_iter` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info)

View File

@@ -0,0 +1,7 @@
use quote::quote_spanned;
fn main() {
let span = "";
let x = 0i32;
quote_spanned!(span=> #x);
}

View File

@@ -0,0 +1,10 @@
error[E0308]: mismatched types
--> tests/ui/wrong-type-span.rs:6:5
|
6 | quote_spanned!(span=> #x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| expected `Span`, found `&str`
| expected due to this
|
= note: this error originates in the macro `quote_spanned` (in Nightly builds, run with -Z macro-backtrace for more info)