]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/generic-associated-types/issue-76535.rs
1 #![feature(generic_associated_types)]
2 //~^ WARNING the feature
7 type SubType
<'a
>: SubTrait
;
8 //~^ ERROR missing generics for associated
10 fn get_sub
<'a
>(&'a
mut self) -> Self::SubType
<'a
>;
13 pub struct SubStruct
<'a
> {
14 sup
: &'a
mut SuperStruct
,
17 impl<'a
> SubTrait
for SubStruct
<'a
> {}
19 pub struct SuperStruct
{
24 pub fn new(value
: u8) -> SuperStruct
{
29 impl SuperTrait
for SuperStruct
{
30 type SubType
<'a
> = SubStruct
<'a
>;
32 fn get_sub
<'a
>(&'a
mut self) -> Self::SubType
<'a
> {
33 SubStruct { sup: self }
38 let sub
: Box
<dyn SuperTrait
<SubType
= SubStruct
>> = Box
::new(SuperStruct
::new(0));