summaryrefslogtreecommitdiffstats
path: root/third_party/rust/rustversion/tests/ui
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /third_party/rust/rustversion/tests/ui
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/rustversion/tests/ui')
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-bound.rs7
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-bound.stderr11
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-date.rs7
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-date.stderr11
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-not.rs7
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-not.stderr11
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-version.rs7
-rw-r--r--third_party/rust/rustversion/tests/ui/bad-version.stderr11
-rw-r--r--third_party/rust/rustversion/tests/ui/const-not-fn.rs4
-rw-r--r--third_party/rust/rustversion/tests/ui/const-not-fn.stderr5
10 files changed, 81 insertions, 0 deletions
diff --git a/third_party/rust/rustversion/tests/ui/bad-bound.rs b/third_party/rust/rustversion/tests/ui/bad-bound.rs
new file mode 100644
index 0000000000..add8792eb1
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-bound.rs
@@ -0,0 +1,7 @@
+#[rustversion::since(stable)]
+struct S;
+
+#[rustversion::any(since(stable))]
+struct S;
+
+fn main() {}
diff --git a/third_party/rust/rustversion/tests/ui/bad-bound.stderr b/third_party/rust/rustversion/tests/ui/bad-bound.stderr
new file mode 100644
index 0000000000..77956c66db
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-bound.stderr
@@ -0,0 +1,11 @@
+error: expected rustc release number like 1.31, or nightly date like 2020-02-25
+ --> tests/ui/bad-bound.rs:1:22
+ |
+1 | #[rustversion::since(stable)]
+ | ^^^^^^
+
+error: expected rustc release number like 1.31, or nightly date like 2020-02-25
+ --> tests/ui/bad-bound.rs:4:26
+ |
+4 | #[rustversion::any(since(stable))]
+ | ^^^^^^
diff --git a/third_party/rust/rustversion/tests/ui/bad-date.rs b/third_party/rust/rustversion/tests/ui/bad-date.rs
new file mode 100644
index 0000000000..09846254b0
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-date.rs
@@ -0,0 +1,7 @@
+#[rustversion::nightly(stable)]
+struct S;
+
+#[rustversion::any(nightly(stable))]
+struct S;
+
+fn main() {}
diff --git a/third_party/rust/rustversion/tests/ui/bad-date.stderr b/third_party/rust/rustversion/tests/ui/bad-date.stderr
new file mode 100644
index 0000000000..378b00e0da
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-date.stderr
@@ -0,0 +1,11 @@
+error: expected nightly date, like 2020-02-25
+ --> tests/ui/bad-date.rs:1:24
+ |
+1 | #[rustversion::nightly(stable)]
+ | ^^^^^^
+
+error: expected nightly date, like 2020-02-25
+ --> tests/ui/bad-date.rs:4:28
+ |
+4 | #[rustversion::any(nightly(stable))]
+ | ^^^^^^
diff --git a/third_party/rust/rustversion/tests/ui/bad-not.rs b/third_party/rust/rustversion/tests/ui/bad-not.rs
new file mode 100644
index 0000000000..058f340f69
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-not.rs
@@ -0,0 +1,7 @@
+#[rustversion::any(not)]
+struct S;
+
+#[rustversion::any(not, not)]
+struct S;
+
+fn main() {}
diff --git a/third_party/rust/rustversion/tests/ui/bad-not.stderr b/third_party/rust/rustversion/tests/ui/bad-not.stderr
new file mode 100644
index 0000000000..2b0c699332
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-not.stderr
@@ -0,0 +1,11 @@
+error: expected `(` after `not`
+ --> tests/ui/bad-not.rs:1:20
+ |
+1 | #[rustversion::any(not)]
+ | ^^^
+
+error: expected `(`
+ --> tests/ui/bad-not.rs:4:23
+ |
+4 | #[rustversion::any(not, not)]
+ | ^
diff --git a/third_party/rust/rustversion/tests/ui/bad-version.rs b/third_party/rust/rustversion/tests/ui/bad-version.rs
new file mode 100644
index 0000000000..1fe8dba166
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-version.rs
@@ -0,0 +1,7 @@
+#[rustversion::stable(nightly)]
+struct S;
+
+#[rustversion::any(stable(nightly))]
+struct S;
+
+fn main() {}
diff --git a/third_party/rust/rustversion/tests/ui/bad-version.stderr b/third_party/rust/rustversion/tests/ui/bad-version.stderr
new file mode 100644
index 0000000000..bf3f144b15
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/bad-version.stderr
@@ -0,0 +1,11 @@
+error: expected rustc release number, like 1.31
+ --> tests/ui/bad-version.rs:1:23
+ |
+1 | #[rustversion::stable(nightly)]
+ | ^^^^^^^
+
+error: expected rustc release number, like 1.31
+ --> tests/ui/bad-version.rs:4:27
+ |
+4 | #[rustversion::any(stable(nightly))]
+ | ^^^^^^^
diff --git a/third_party/rust/rustversion/tests/ui/const-not-fn.rs b/third_party/rust/rustversion/tests/ui/const-not-fn.rs
new file mode 100644
index 0000000000..215df7d7d0
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/const-not-fn.rs
@@ -0,0 +1,4 @@
+#[rustversion::attr(all(), const)]
+pub struct S;
+
+fn main() {}
diff --git a/third_party/rust/rustversion/tests/ui/const-not-fn.stderr b/third_party/rust/rustversion/tests/ui/const-not-fn.stderr
new file mode 100644
index 0000000000..d3cb4aa678
--- /dev/null
+++ b/third_party/rust/rustversion/tests/ui/const-not-fn.stderr
@@ -0,0 +1,5 @@
+error: only allowed on a fn item
+ --> tests/ui/const-not-fn.rs:1:28
+ |
+1 | #[rustversion::attr(all(), const)]
+ | ^^^^^