summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/default-method
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/traits/default-method
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/traits/default-method/auxiliary/xc.rs (renamed from src/test/ui/traits/default-method/auxiliary/xc.rs)0
-rw-r--r--tests/ui/traits/default-method/auxiliary/xc_2.rs (renamed from src/test/ui/traits/default-method/auxiliary/xc_2.rs)0
-rw-r--r--tests/ui/traits/default-method/bound-subst.rs (renamed from src/test/ui/traits/default-method/bound-subst.rs)0
-rw-r--r--tests/ui/traits/default-method/bound-subst2.rs (renamed from src/test/ui/traits/default-method/bound-subst2.rs)0
-rw-r--r--tests/ui/traits/default-method/bound-subst3.rs (renamed from src/test/ui/traits/default-method/bound-subst3.rs)0
-rw-r--r--tests/ui/traits/default-method/bound-subst4.rs (renamed from src/test/ui/traits/default-method/bound-subst4.rs)0
-rw-r--r--tests/ui/traits/default-method/bound.rs (renamed from src/test/ui/traits/default-method/bound.rs)0
-rw-r--r--tests/ui/traits/default-method/macro.rs (renamed from src/test/ui/traits/default-method/macro.rs)0
-rw-r--r--tests/ui/traits/default-method/mut.rs (renamed from src/test/ui/traits/default-method/mut.rs)0
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of.rs (renamed from src/test/ui/traits/default-method/rustc_must_implement_one_of.rs)0
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of.stderr (renamed from src/test/ui/traits/default-method/rustc_must_implement_one_of.stderr)0
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.rs19
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.stderr34
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs (renamed from src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs)0
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr (renamed from src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr)0
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs46
-rw-r--r--tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr (renamed from src/test/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr)18
-rw-r--r--tests/ui/traits/default-method/self.rs (renamed from src/test/ui/traits/default-method/self.rs)0
-rw-r--r--tests/ui/traits/default-method/supervtable.rs (renamed from src/test/ui/traits/default-method/supervtable.rs)0
-rw-r--r--tests/ui/traits/default-method/trivial.rs (renamed from src/test/ui/traits/default-method/trivial.rs)0
-rw-r--r--tests/ui/traits/default-method/xc-2.rs (renamed from src/test/ui/traits/default-method/xc-2.rs)0
-rw-r--r--tests/ui/traits/default-method/xc.rs (renamed from src/test/ui/traits/default-method/xc.rs)0
22 files changed, 108 insertions, 9 deletions
diff --git a/src/test/ui/traits/default-method/auxiliary/xc.rs b/tests/ui/traits/default-method/auxiliary/xc.rs
index 0fb26af80..0fb26af80 100644
--- a/src/test/ui/traits/default-method/auxiliary/xc.rs
+++ b/tests/ui/traits/default-method/auxiliary/xc.rs
diff --git a/src/test/ui/traits/default-method/auxiliary/xc_2.rs b/tests/ui/traits/default-method/auxiliary/xc_2.rs
index 979233820..979233820 100644
--- a/src/test/ui/traits/default-method/auxiliary/xc_2.rs
+++ b/tests/ui/traits/default-method/auxiliary/xc_2.rs
diff --git a/src/test/ui/traits/default-method/bound-subst.rs b/tests/ui/traits/default-method/bound-subst.rs
index 6a5d5c8ba..6a5d5c8ba 100644
--- a/src/test/ui/traits/default-method/bound-subst.rs
+++ b/tests/ui/traits/default-method/bound-subst.rs
diff --git a/src/test/ui/traits/default-method/bound-subst2.rs b/tests/ui/traits/default-method/bound-subst2.rs
index 78eabba2d..78eabba2d 100644
--- a/src/test/ui/traits/default-method/bound-subst2.rs
+++ b/tests/ui/traits/default-method/bound-subst2.rs
diff --git a/src/test/ui/traits/default-method/bound-subst3.rs b/tests/ui/traits/default-method/bound-subst3.rs
index dd39dec4b..dd39dec4b 100644
--- a/src/test/ui/traits/default-method/bound-subst3.rs
+++ b/tests/ui/traits/default-method/bound-subst3.rs
diff --git a/src/test/ui/traits/default-method/bound-subst4.rs b/tests/ui/traits/default-method/bound-subst4.rs
index ef1330645..ef1330645 100644
--- a/src/test/ui/traits/default-method/bound-subst4.rs
+++ b/tests/ui/traits/default-method/bound-subst4.rs
diff --git a/src/test/ui/traits/default-method/bound.rs b/tests/ui/traits/default-method/bound.rs
index 0855a9db8..0855a9db8 100644
--- a/src/test/ui/traits/default-method/bound.rs
+++ b/tests/ui/traits/default-method/bound.rs
diff --git a/src/test/ui/traits/default-method/macro.rs b/tests/ui/traits/default-method/macro.rs
index 2b50ee9b4..2b50ee9b4 100644
--- a/src/test/ui/traits/default-method/macro.rs
+++ b/tests/ui/traits/default-method/macro.rs
diff --git a/src/test/ui/traits/default-method/mut.rs b/tests/ui/traits/default-method/mut.rs
index 5f8e983b0..5f8e983b0 100644
--- a/src/test/ui/traits/default-method/mut.rs
+++ b/tests/ui/traits/default-method/mut.rs
diff --git a/src/test/ui/traits/default-method/rustc_must_implement_one_of.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of.rs
index 5ba2f5ce3..5ba2f5ce3 100644
--- a/src/test/ui/traits/default-method/rustc_must_implement_one_of.rs
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of.rs
diff --git a/src/test/ui/traits/default-method/rustc_must_implement_one_of.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of.stderr
index 5a4dd1388..5a4dd1388 100644
--- a/src/test/ui/traits/default-method/rustc_must_implement_one_of.stderr
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of.stderr
diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.rs
new file mode 100644
index 000000000..8db5fa615
--- /dev/null
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.rs
@@ -0,0 +1,19 @@
+#![feature(rustc_attrs)]
+
+#[rustc_must_implement_one_of(a, a)]
+//~^ functions names are duplicated
+trait Trait {
+ fn a() {}
+}
+
+#[rustc_must_implement_one_of(b, a, a, c, b, c)]
+//~^ functions names are duplicated
+//~| functions names are duplicated
+//~| functions names are duplicated
+trait Trait1 {
+ fn a() {}
+ fn b() {}
+ fn c() {}
+}
+
+fn main() {}
diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.stderr
new file mode 100644
index 000000000..cd1476a6e
--- /dev/null
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_duplicates.stderr
@@ -0,0 +1,34 @@
+error: functions names are duplicated
+ --> $DIR/rustc_must_implement_one_of_duplicates.rs:3:31
+ |
+LL | #[rustc_must_implement_one_of(a, a)]
+ | ^ ^
+ |
+ = note: all `#[rustc_must_implement_one_of]` arguments must be unique
+
+error: functions names are duplicated
+ --> $DIR/rustc_must_implement_one_of_duplicates.rs:9:34
+ |
+LL | #[rustc_must_implement_one_of(b, a, a, c, b, c)]
+ | ^ ^
+ |
+ = note: all `#[rustc_must_implement_one_of]` arguments must be unique
+
+error: functions names are duplicated
+ --> $DIR/rustc_must_implement_one_of_duplicates.rs:9:31
+ |
+LL | #[rustc_must_implement_one_of(b, a, a, c, b, c)]
+ | ^ ^
+ |
+ = note: all `#[rustc_must_implement_one_of]` arguments must be unique
+
+error: functions names are duplicated
+ --> $DIR/rustc_must_implement_one_of_duplicates.rs:9:40
+ |
+LL | #[rustc_must_implement_one_of(b, a, a, c, b, c)]
+ | ^ ^
+ |
+ = note: all `#[rustc_must_implement_one_of]` arguments must be unique
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs
index ec2995872..ec2995872 100644
--- a/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.rs
diff --git a/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr
index 228bc3e35..228bc3e35 100644
--- a/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_gated.stderr
diff --git a/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs
new file mode 100644
index 000000000..b1b91966c
--- /dev/null
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.rs
@@ -0,0 +1,46 @@
+#![feature(rustc_attrs)]
+
+#[rustc_must_implement_one_of(a, b)]
+//~^ function not found in this trait
+//~| function not found in this trait
+trait Tr0 {}
+
+#[rustc_must_implement_one_of(a, b)]
+//~^ function not found in this trait
+trait Tr1 {
+ fn a() {}
+}
+
+#[rustc_must_implement_one_of(a)]
+//~^ the `#[rustc_must_implement_one_of]` attribute must be used with at least 2 args
+trait Tr2 {
+ fn a() {}
+}
+
+#[rustc_must_implement_one_of]
+//~^ malformed `rustc_must_implement_one_of` attribute input
+trait Tr3 {}
+
+#[rustc_must_implement_one_of(A, B)]
+trait Tr4 {
+ const A: u8 = 1; //~ not a function
+
+ type B; //~ not a function
+}
+
+#[rustc_must_implement_one_of(a, b)]
+trait Tr5 {
+ fn a(); //~ function doesn't have a default implementation
+
+ fn b(); //~ function doesn't have a default implementation
+}
+
+#[rustc_must_implement_one_of(abc, xyz)]
+//~^ attribute should be applied to a trait
+fn function() {}
+
+#[rustc_must_implement_one_of(abc, xyz)]
+//~^ attribute should be applied to a trait
+struct Struct {}
+
+fn main() {}
diff --git a/src/test/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr
index 869184f0d..38e692521 100644
--- a/src/test/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr
+++ b/tests/ui/traits/default-method/rustc_must_implement_one_of_misuse.stderr
@@ -22,19 +22,19 @@ LL |
LL | struct Struct {}
| ---------------- not a trait
-error: Function not found in this trait
+error: function not found in this trait
--> $DIR/rustc_must_implement_one_of_misuse.rs:3:31
|
LL | #[rustc_must_implement_one_of(a, b)]
| ^
-error: Function not found in this trait
+error: function not found in this trait
--> $DIR/rustc_must_implement_one_of_misuse.rs:3:34
|
LL | #[rustc_must_implement_one_of(a, b)]
| ^
-error: Function not found in this trait
+error: function not found in this trait
--> $DIR/rustc_must_implement_one_of_misuse.rs:8:34
|
LL | #[rustc_must_implement_one_of(a, b)]
@@ -46,7 +46,7 @@ error: the `#[rustc_must_implement_one_of]` attribute must be used with at least
LL | #[rustc_must_implement_one_of(a)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: Not a function
+error: not a function
--> $DIR/rustc_must_implement_one_of_misuse.rs:26:5
|
LL | const A: u8 = 1;
@@ -57,9 +57,9 @@ note: required by this annotation
|
LL | #[rustc_must_implement_one_of(A, B)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: All `#[rustc_must_implement_one_of]` arguments must be associated function names
+ = note: all `#[rustc_must_implement_one_of]` arguments must be associated function names
-error: Not a function
+error: not a function
--> $DIR/rustc_must_implement_one_of_misuse.rs:28:5
|
LL | type B;
@@ -70,9 +70,9 @@ note: required by this annotation
|
LL | #[rustc_must_implement_one_of(A, B)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- = note: All `#[rustc_must_implement_one_of]` arguments must be associated function names
+ = note: all `#[rustc_must_implement_one_of]` arguments must be associated function names
-error: This function doesn't have a default implementation
+error: function doesn't have a default implementation
--> $DIR/rustc_must_implement_one_of_misuse.rs:33:5
|
LL | fn a();
@@ -84,7 +84,7 @@ note: required by this annotation
LL | #[rustc_must_implement_one_of(a, b)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: This function doesn't have a default implementation
+error: function doesn't have a default implementation
--> $DIR/rustc_must_implement_one_of_misuse.rs:35:5
|
LL | fn b();
diff --git a/src/test/ui/traits/default-method/self.rs b/tests/ui/traits/default-method/self.rs
index cdf4d1e14..cdf4d1e14 100644
--- a/src/test/ui/traits/default-method/self.rs
+++ b/tests/ui/traits/default-method/self.rs
diff --git a/src/test/ui/traits/default-method/supervtable.rs b/tests/ui/traits/default-method/supervtable.rs
index 939ad5135..939ad5135 100644
--- a/src/test/ui/traits/default-method/supervtable.rs
+++ b/tests/ui/traits/default-method/supervtable.rs
diff --git a/src/test/ui/traits/default-method/trivial.rs b/tests/ui/traits/default-method/trivial.rs
index dc41938ec..dc41938ec 100644
--- a/src/test/ui/traits/default-method/trivial.rs
+++ b/tests/ui/traits/default-method/trivial.rs
diff --git a/src/test/ui/traits/default-method/xc-2.rs b/tests/ui/traits/default-method/xc-2.rs
index 1de61dcf8..1de61dcf8 100644
--- a/src/test/ui/traits/default-method/xc-2.rs
+++ b/tests/ui/traits/default-method/xc-2.rs
diff --git a/src/test/ui/traits/default-method/xc.rs b/tests/ui/traits/default-method/xc.rs
index 76a1573d6..76a1573d6 100644
--- a/src/test/ui/traits/default-method/xc.rs
+++ b/tests/ui/traits/default-method/xc.rs