about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2022-08-22 11:28:01 +0000
committerDeadbeef <ent3rm4n@gmail.com>2022-08-22 11:28:01 +0000
commitf019b6c5e8f2bb7e5985ea595b0946479c5aa4c2 (patch)
tree1c9cce6d9a8dabc30ae8a1fa4169310661d20188 /src/test/ui
parent460daf34346e621ad31ad68832a2c573aa723906 (diff)
downloadrust-f019b6c5e8f2bb7e5985ea595b0946479c5aa4c2.tar.gz
rust-f019b6c5e8f2bb7e5985ea595b0946479c5aa4c2.zip
Overhaul 100222 test; wf always remap to nonconst
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs
index 40517ecdd6c..2db5595a5ae 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-100222.rs
@@ -1,14 +1,27 @@
+// revisions: nn ny yn yy
 // check-pass
-#![feature(const_trait_impl)]
+#![feature(const_trait_impl, associated_type_defaults, const_mut_refs)]
 
-#[const_trait]
+#[cfg_attr(any(yn, yy), const_trait)]
 pub trait Index {
     type Output;
 }
 
-#[const_trait]
+#[cfg_attr(any(ny, yy), const_trait)]
 pub trait IndexMut where Self: Index {
-    fn foo(&mut self) -> <Self as Index>::Output;
+    const C: <Self as Index>::Output;
+    type Assoc = <Self as Index>::Output;
+    fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output;
 }
 
+impl Index for () { type Output = (); }
+
+impl const IndexMut for <() as Index>::Output {
+    const C: <Self as Index>::Output = ();
+    type Assoc = <Self as Index>::Output;
+    fn foo(&mut self, x: <Self as Index>::Output) -> <Self as Index>::Output where <Self as Index>::Output: {}
+}
+
+const C: <() as Index>::Output = ();
+
 fn main() {}