Vendor things

This commit is contained in:
John Doty 2024-03-08 11:03:01 -08:00
parent 5deceec006
commit 977e3c17e5
19434 changed files with 10682014 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#![deny(warnings)]
use paste::paste;
macro_rules! m {
($i:ident) => {
paste! {
pub fn [<foo $i>]() {}
}
};
}
m!(Bar);
fn main() {}

View file

@ -0,0 +1,16 @@
error: function `fooBar` should have a snake case name
--> tests/ui/case-warning.rs:8:20
|
8 | pub fn [<foo $i>]() {}
| ^^^^^^^^^^ help: convert the identifier to snake case: `foo_bar`
...
13 | m!(Bar);
| ------- in this macro invocation
|
note: the lint level is defined here
--> tests/ui/case-warning.rs:1:9
|
1 | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(non_snake_case)]` implied by `#[deny(warnings)]`
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<env!()>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: expected string literal as argument to env! macro
--> tests/ui/env-empty.rs:4:10
|
4 | fn [<env!()>]() {}
| ^^^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<env!(1.31)>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: expected string literal
--> tests/ui/env-non-string.rs:4:15
|
4 | fn [<env!(1.31)>]() {}
| ^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<env!("VAR"suffix)>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: expected string literal
--> tests/ui/env-suffix.rs:4:15
|
4 | fn [<env!("VAR"suffix)>]() {}
| ^^^^^^^^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<env!("VAR" "VAR")>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: unexpected token in env! macro
--> tests/ui/env-unexpected.rs:4:21
|
4 | fn [<env!("VAR" "VAR")>]() {}
| ^^^^^

View file

@ -0,0 +1,15 @@
use paste::paste;
paste! {
fn [<0 f>]() {}
}
paste! {
fn [<f '"'>]() {}
}
paste! {
fn [<f "'">]() {}
}
fn main() {}

View file

@ -0,0 +1,26 @@
error: expected identifier, found `0f`
--> tests/ui/invalid-ident.rs:3:1
|
3 | / paste! {
4 | | fn [<0 f>]() {}
5 | | }
| |_^ expected identifier
|
help: identifiers cannot start with a number
--> tests/ui/invalid-ident.rs:3:1
|
3 | paste! {
| ^
= note: this error originates in the macro `paste` (in Nightly builds, run with -Z macro-backtrace for more info)
error: `"f\""` is not a valid identifier
--> tests/ui/invalid-ident.rs:8:8
|
8 | fn [<f '"'>]() {}
| ^^^^^^^^^
error: `"f'"` is not a valid identifier
--> tests/ui/invalid-ident.rs:12:8
|
12 | fn [<f "'">]() {}
| ^^^^^^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<env! huh>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: expected `(`
--> tests/ui/missing-paren-on-env.rs:4:15
|
4 | fn [<env! huh>]() {}
| ^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<a env!("PASTE_UNKNOWN") b>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: no such env var: "PASTE_UNKNOWN"
--> tests/ui/no-env-var.rs:4:17
|
4 | fn [<a env!("PASTE_UNKNOWN") b>]() {}
| ^^^^^^^^^^^^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<name:0>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: expected identifier after `:`
--> tests/ui/no-ident-after-colon.rs:4:15
|
4 | fn [<name:0>]() {}
| ^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<a {} b>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: unexpected token
--> tests/ui/unexpected-group.rs:4:12
|
4 | fn [<a {} b>]() {}
| ^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<:lower x>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: unexpected modifier
--> tests/ui/unexpected-modifier.rs:4:10
|
4 | fn [<:lower x>]() {}
| ^^^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<a + b>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: unexpected punct
--> tests/ui/unexpected-punct.rs:4:12
|
4 | fn [<a + b>]() {}
| ^

View file

@ -0,0 +1,21 @@
use paste::paste;
paste! {
fn [<x 1e+100 z>]() {}
}
paste! {
// `xyz` is not correct. `xbyz` is certainly not correct. Maybe `x121z`
// would be justifiable but for now don't accept this.
fn [<x b'y' z>]() {}
}
paste! {
fn [<x b"y" z>]() {}
}
paste! {
fn [<x br"y" z>]() {}
}
fn main() {}

View file

@ -0,0 +1,23 @@
error: unsupported literal
--> tests/ui/unsupported-literal.rs:4:12
|
4 | fn [<x 1e+100 z>]() {}
| ^^^^^^
error: unsupported literal
--> tests/ui/unsupported-literal.rs:10:12
|
10 | fn [<x b'y' z>]() {}
| ^^^^
error: unsupported literal
--> tests/ui/unsupported-literal.rs:14:12
|
14 | fn [<x b"y" z>]() {}
| ^^^^
error: unsupported literal
--> tests/ui/unsupported-literal.rs:18:12
|
18 | fn [<x br"y" z>]() {}
| ^^^^^

View file

@ -0,0 +1,7 @@
use paste::paste;
paste! {
fn [<a:pillow>]() {}
}
fn main() {}

View file

@ -0,0 +1,5 @@
error: unsupported modifier
--> tests/ui/unsupported-modifier.rs:4:11
|
4 | fn [<a:pillow>]() {}
| ^^^^^^^