aboutsummaryrefslogtreecommitdiff
path: root/quote/tests/ui
diff options
context:
space:
mode:
authorRobin Krahl <robin.krahl@ireas.org>2020-01-07 11:18:04 +0000
committerDaniel Mueller <deso@posteo.net>2020-01-08 09:20:25 -0800
commit5e20a29b4fdc8a2d442d1093681b396dcb4b816b (patch)
tree55ab083fa8999d2ccbb5e921c1ffe52560dca152 /quote/tests/ui
parent203e691f46d591a2cc8acdfd850fa9f5b0fb8a98 (diff)
downloadnitrocli-5e20a29b4fdc8a2d442d1093681b396dcb4b816b.tar.gz
nitrocli-5e20a29b4fdc8a2d442d1093681b396dcb4b816b.tar.bz2
Add structopt dependency in version 0.3.7
This patch series replaces argparse with structopt in the argument handling code. As a first step, we need structopt as a dependency. Import subrepo structopt/:structopt at efbdda4753592e27bc430fb01f7b9650b2f3174d Import subrepo bitflags/:bitflags at 30668016aca6bd3b02c766e8347e0b4080d4c296 Import subrepo clap/:clap at 784524f7eb193e35f81082cc69454c8c21b948f7 Import subrepo heck/:heck at 093d56fbf001e1506e56dbfa38631d99b1066df1 Import subrepo proc-macro-error/:proc-macro-error at 6c4cfe79a622c5de8ae68557993542be46eacae2 Import subrepo proc-macro2/:proc-macro2 at d5d48eddca4566e5438e8a2cbed4a74e049544de Import subrepo quote/:quote at 727436c6c137b20f0f34dde5d8fda2679b9747ad Import subrepo rustversion/:rustversion at 0c5663313516263059ce9059ef81fc7a1cf655ca Import subrepo syn-mid/:syn-mid at 5d3d85414a9e6674e1857ec22a87b96e04a6851a Import subrepo syn/:syn at e87c27e87f6f4ef8919d0372bdb056d53ef0d8f3 Import subrepo textwrap/:textwrap at abcd618beae3f74841032aa5b53c1086b0a57ca2 Import subrepo unicode-segmentation/:unicode-segmentation at 637c9874c4fe0c205ff27787faf150a40295c6c3 Import subrepo unicode-width/:unicode-width at 3033826f8bf05e82724140a981d5941e48fce393 Import subrepo unicode-xid/:unicode-xid at 4baae9fffb156ba229665b972a9cd5991787ceb7
Diffstat (limited to 'quote/tests/ui')
-rw-r--r--quote/tests/ui/does-not-have-iter-interpolated-dup.rs9
-rw-r--r--quote/tests/ui/does-not-have-iter-interpolated-dup.stderr11
-rw-r--r--quote/tests/ui/does-not-have-iter-interpolated.rs9
-rw-r--r--quote/tests/ui/does-not-have-iter-interpolated.stderr11
-rw-r--r--quote/tests/ui/does-not-have-iter-separated.rs5
-rw-r--r--quote/tests/ui/does-not-have-iter-separated.stderr11
-rw-r--r--quote/tests/ui/does-not-have-iter.rs5
-rw-r--r--quote/tests/ui/does-not-have-iter.stderr11
-rw-r--r--quote/tests/ui/not-quotable.rs7
-rw-r--r--quote/tests/ui/not-quotable.stderr10
-rw-r--r--quote/tests/ui/not-repeatable.rs7
-rw-r--r--quote/tests/ui/not-repeatable.stderr14
-rw-r--r--quote/tests/ui/wrong-type-span.rs7
-rw-r--r--quote/tests/ui/wrong-type-span.stderr10
14 files changed, 127 insertions, 0 deletions
diff --git a/quote/tests/ui/does-not-have-iter-interpolated-dup.rs b/quote/tests/ui/does-not-have-iter-interpolated-dup.rs
new file mode 100644
index 0000000..0a39f41
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter-interpolated-dup.rs
@@ -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)*);
+}
diff --git a/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr b/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr
new file mode 100644
index 0000000..6ee6fdf
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter-interpolated-dup.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/does-not-have-iter-interpolated-dup.rs:8:5
+ |
+8 | quote!(#(#nonrep #nonrep)*);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `quote::__rt::HasIterator`, found struct `quote::__rt::ThereIsNoIteratorInRepetition`
+ |
+ = note: expected type `quote::__rt::HasIterator`
+ found type `quote::__rt::ThereIsNoIteratorInRepetition`
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/quote/tests/ui/does-not-have-iter-interpolated.rs b/quote/tests/ui/does-not-have-iter-interpolated.rs
new file mode 100644
index 0000000..2c740cc
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter-interpolated.rs
@@ -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)*);
+}
diff --git a/quote/tests/ui/does-not-have-iter-interpolated.stderr b/quote/tests/ui/does-not-have-iter-interpolated.stderr
new file mode 100644
index 0000000..8d6c990
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter-interpolated.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/does-not-have-iter-interpolated.rs:8:5
+ |
+8 | quote!(#(#nonrep)*);
+ | ^^^^^^^^^^^^^^^^^^^^ expected struct `quote::__rt::HasIterator`, found struct `quote::__rt::ThereIsNoIteratorInRepetition`
+ |
+ = note: expected type `quote::__rt::HasIterator`
+ found type `quote::__rt::ThereIsNoIteratorInRepetition`
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/quote/tests/ui/does-not-have-iter-separated.rs b/quote/tests/ui/does-not-have-iter-separated.rs
new file mode 100644
index 0000000..c027243
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter-separated.rs
@@ -0,0 +1,5 @@
+use quote::quote;
+
+fn main() {
+ quote!(#(a b),*);
+}
diff --git a/quote/tests/ui/does-not-have-iter-separated.stderr b/quote/tests/ui/does-not-have-iter-separated.stderr
new file mode 100644
index 0000000..c1fd0ad
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter-separated.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/does-not-have-iter-separated.rs:4:5
+ |
+4 | quote!(#(a b),*);
+ | ^^^^^^^^^^^^^^^^^ expected struct `quote::__rt::HasIterator`, found struct `quote::__rt::ThereIsNoIteratorInRepetition`
+ |
+ = note: expected type `quote::__rt::HasIterator`
+ found type `quote::__rt::ThereIsNoIteratorInRepetition`
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/quote/tests/ui/does-not-have-iter.rs b/quote/tests/ui/does-not-have-iter.rs
new file mode 100644
index 0000000..8908353
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter.rs
@@ -0,0 +1,5 @@
+use quote::quote;
+
+fn main() {
+ quote!(#(a b)*);
+}
diff --git a/quote/tests/ui/does-not-have-iter.stderr b/quote/tests/ui/does-not-have-iter.stderr
new file mode 100644
index 0000000..3b87705
--- /dev/null
+++ b/quote/tests/ui/does-not-have-iter.stderr
@@ -0,0 +1,11 @@
+error[E0308]: mismatched types
+ --> $DIR/does-not-have-iter.rs:4:5
+ |
+4 | quote!(#(a b)*);
+ | ^^^^^^^^^^^^^^^^ expected struct `quote::__rt::HasIterator`, found struct `quote::__rt::ThereIsNoIteratorInRepetition`
+ |
+ = note: expected type `quote::__rt::HasIterator`
+ found type `quote::__rt::ThereIsNoIteratorInRepetition`
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/quote/tests/ui/not-quotable.rs b/quote/tests/ui/not-quotable.rs
new file mode 100644
index 0000000..f991c18
--- /dev/null
+++ b/quote/tests/ui/not-quotable.rs
@@ -0,0 +1,7 @@
+use quote::quote;
+use std::net::Ipv4Addr;
+
+fn main() {
+ let ip = Ipv4Addr::LOCALHOST;
+ let _ = quote! { #ip };
+}
diff --git a/quote/tests/ui/not-quotable.stderr b/quote/tests/ui/not-quotable.stderr
new file mode 100644
index 0000000..f51f85f
--- /dev/null
+++ b/quote/tests/ui/not-quotable.stderr
@@ -0,0 +1,10 @@
+error[E0277]: the trait bound `std::net::Ipv4Addr: quote::to_tokens::ToTokens` is not satisfied
+ --> $DIR/not-quotable.rs:6:13
+ |
+6 | let _ = quote! { #ip };
+ | ^^^^^^^^^^^^^^ the trait `quote::to_tokens::ToTokens` is not implemented for `std::net::Ipv4Addr`
+ |
+ = note: required by `quote::to_tokens::ToTokens::to_tokens`
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/quote/tests/ui/not-repeatable.rs b/quote/tests/ui/not-repeatable.rs
new file mode 100644
index 0000000..ff18060
--- /dev/null
+++ b/quote/tests/ui/not-repeatable.rs
@@ -0,0 +1,7 @@
+use quote::quote;
+use std::net::Ipv4Addr;
+
+fn main() {
+ let ip = Ipv4Addr::LOCALHOST;
+ let _ = quote! { #(#ip)* };
+}
diff --git a/quote/tests/ui/not-repeatable.stderr b/quote/tests/ui/not-repeatable.stderr
new file mode 100644
index 0000000..ddcac05
--- /dev/null
+++ b/quote/tests/ui/not-repeatable.stderr
@@ -0,0 +1,14 @@
+error[E0599]: no method named `quote_into_iter` found for type `std::net::Ipv4Addr` in the current scope
+ --> $DIR/not-repeatable.rs:6:13
+ |
+6 | let _ = quote! { #(#ip)* };
+ | ^^^^^^^^^^^^^^^^^^
+ |
+ = note: the method `quote_into_iter` exists but the following trait bounds were not satisfied:
+ `&mut std::net::Ipv4Addr : quote::__rt::ext::RepIteratorExt`
+ `&std::net::Ipv4Addr : quote::__rt::ext::RepIteratorExt`
+ `std::net::Ipv4Addr : quote::__rt::ext::RepIteratorExt`
+ `std::net::Ipv4Addr : quote::__rt::ext::RepToTokensExt`
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/quote/tests/ui/wrong-type-span.rs b/quote/tests/ui/wrong-type-span.rs
new file mode 100644
index 0000000..1ce391c
--- /dev/null
+++ b/quote/tests/ui/wrong-type-span.rs
@@ -0,0 +1,7 @@
+use quote::quote_spanned;
+
+fn main() {
+ let span = "";
+ let x = 0;
+ quote_spanned!(span=> #x);
+}
diff --git a/quote/tests/ui/wrong-type-span.stderr b/quote/tests/ui/wrong-type-span.stderr
new file mode 100644
index 0000000..a6ae8ef
--- /dev/null
+++ b/quote/tests/ui/wrong-type-span.stderr
@@ -0,0 +1,10 @@
+error[E0308]: mismatched types
+ --> $DIR/wrong-type-span.rs:6:20
+ |
+6 | quote_spanned!(span=> #x);
+ | ^^^^ expected struct `proc_macro2::Span`, found &str
+ |
+ = note: expected type `proc_macro2::Span`
+ found type `&str`
+
+For more information about this error, try `rustc --explain E0308`.