summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/vec.fixed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /src/tools/clippy/tests/ui/vec.fixed
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/vec.fixed')
-rw-r--r--src/tools/clippy/tests/ui/vec.fixed40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/vec.fixed b/src/tools/clippy/tests/ui/vec.fixed
index fcdc917c1..7a7d0026f 100644
--- a/src/tools/clippy/tests/ui/vec.fixed
+++ b/src/tools/clippy/tests/ui/vec.fixed
@@ -115,6 +115,46 @@ fn main() {
let _x = vec![1; 201];
}
+fn issue11075() {
+ macro_rules! repro {
+ ($e:expr) => {
+ stringify!($e)
+ };
+ }
+ for _string in [repro!(true), repro!(null)] {
+ unimplemented!();
+ }
+
+ macro_rules! in_macro {
+ ($e:expr, $vec:expr, $vec2:expr) => {{
+ vec![1; 2].fill(3);
+ vec![1, 2].fill(3);
+ for _ in vec![1, 2] {}
+ for _ in vec![1; 2] {}
+ for _ in vec![$e, $e] {}
+ for _ in vec![$e; 2] {}
+ for _ in $vec {}
+ for _ in $vec2 {}
+ }};
+ }
+
+ in_macro!(1, [1, 2], [1; 2]);
+
+ macro_rules! from_macro {
+ () => {
+ vec![1, 2, 3]
+ };
+ }
+ macro_rules! from_macro_repeat {
+ () => {
+ vec![1; 3]
+ };
+ }
+
+ for _ in from_macro!() {}
+ for _ in from_macro_repeat!() {}
+}
+
#[clippy::msrv = "1.53"]
fn above() {
for a in [1, 2, 3] {