]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/generic-associated-types/issue-70303.rs
3 #![feature(generic_associated_types)]
6 type Cursor
<'a
>: DocCursor
<'a
>;
8 fn cursor(&self) -> Self::Cursor
<'_
>;
11 struct DocumentImpl {}
13 impl Document
for DocumentImpl
{
14 type Cursor
<'a
> = DocCursorImpl
<'a
>;
16 fn cursor(&self) -> Self::Cursor
<'_
> {
24 trait DocCursor
<'a
> {}
26 struct DocCursorImpl
<'a
> {
27 document
: &'a DocumentImpl
,
30 impl<'a
> DocCursor
<'a
> for DocCursorImpl
<'a
> {}
32 struct Lexer
<'d
, Cursor
>
34 Cursor
: DocCursor
<'d
>,
37 _phantom
: std
::marker
::PhantomData
<&'
d ()>,
41 impl<'d
, Cursor
> Lexer
<'d
, Cursor
>
43 Cursor
: DocCursor
<'d
>,
45 pub fn from
<Doc
>(document
: &'d Doc
) -> Lexer
<'d
, Cursor
>
47 Doc
: Document
<Cursor
<'d
> = Cursor
>,
50 cursor
: document
.cursor(),
51 _phantom
: std
::marker
::PhantomData
,
57 let doc
= DocumentImpl {}
;
58 let lexer
: Lexer
<'_
, DocCursorImpl
<'_
>> = Lexer
::from(&doc
);