summaryrefslogtreecommitdiffstats
path: root/src/test/ui/specialization/defaultimpl/specialization-no-default.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/specialization/defaultimpl/specialization-no-default.rs
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/specialization/defaultimpl/specialization-no-default.rs')
-rw-r--r--src/test/ui/specialization/defaultimpl/specialization-no-default.rs77
1 files changed, 0 insertions, 77 deletions
diff --git a/src/test/ui/specialization/defaultimpl/specialization-no-default.rs b/src/test/ui/specialization/defaultimpl/specialization-no-default.rs
deleted file mode 100644
index 661724eef..000000000
--- a/src/test/ui/specialization/defaultimpl/specialization-no-default.rs
+++ /dev/null
@@ -1,77 +0,0 @@
-#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
-
-// Check a number of scenarios in which one impl tries to override another,
-// without correctly using `default`.
-
-// Test 1: one layer of specialization, multiple methods, missing `default`
-
-trait Foo {
- fn foo(&self);
- fn bar(&self);
-}
-
-impl<T> Foo for T {
- fn foo(&self) {}
- fn bar(&self) {}
-}
-
-impl Foo for u8 {}
-impl Foo for u16 {
- fn foo(&self) {} //~ ERROR E0520
-}
-impl Foo for u32 {
- fn bar(&self) {} //~ ERROR E0520
-}
-
-// Test 2: one layer of specialization, missing `default` on associated type
-
-trait Bar {
- type T;
-}
-
-impl<T> Bar for T {
- type T = u8;
-}
-
-impl Bar for u8 {
- type T = (); //~ ERROR E0520
-}
-
-// Test 3a: multiple layers of specialization, missing interior `default`
-
-trait Baz {
- fn baz(&self);
-}
-
-default impl<T> Baz for T {
- fn baz(&self) {}
-}
-
-impl<T: Clone> Baz for T {
- fn baz(&self) {}
-}
-
-impl Baz for i32 {
- fn baz(&self) {} //~ ERROR E0520
-}
-
-// Test 3b: multiple layers of specialization, missing interior `default`,
-// redundant `default` in bottom layer.
-
-trait Redundant {
- fn redundant(&self);
-}
-
-default impl<T> Redundant for T {
- fn redundant(&self) {}
-}
-
-impl<T: Clone> Redundant for T {
- fn redundant(&self) {}
-}
-
-default impl Redundant for i32 {
- fn redundant(&self) {} //~ ERROR E0520
-}
-
-fn main() {}