From f019b6c5e8f2bb7e5985ea595b0946479c5aa4c2 Mon Sep 17 00:00:00 2001 From: Deadbeef Date: Mon, 22 Aug 2022 11:28:01 +0000 Subject: Overhaul 100222 test; wf always remap to nonconst --- .../ui/rfc-2632-const-trait-impl/issue-100222.rs | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src') 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) -> ::Output; + const C: ::Output; + type Assoc = ::Output; + fn foo(&mut self, x: ::Output) -> ::Output; } +impl Index for () { type Output = (); } + +impl const IndexMut for <() as Index>::Output { + const C: ::Output = (); + type Assoc = ::Output; + fn foo(&mut self, x: ::Output) -> ::Output where ::Output: {} +} + +const C: <() as Index>::Output = (); + fn main() {} -- cgit 1.4.1-3-g733a5