File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
tests/ui/associated-type-bounds Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ feature( associated_type_bounds) ]
2+
3+ // Test for <https://github.com/rust-lang/rust/issues/119857>.
4+
5+ pub trait Iter {
6+ type Item < ' a > : ' a where Self : ' a ;
7+
8+ fn next < ' a > ( & ' a mut self ) -> Option < Self :: Item < ' a , As1 : Copy > > ;
9+ //~^ ERROR associated type bindings are not allowed here
10+ }
11+
12+ impl Iter for ( ) {
13+ type Item < ' a > = & ' a mut [ ( ) ] ;
14+
15+ fn next < ' a > ( & ' a mut self ) -> Option < Self :: Item < ' a > > { None }
16+ }
17+
18+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0229]: associated type bindings are not allowed here
2+ --> $DIR/no-gat-position.rs:8:56
3+ |
4+ LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>;
5+ | ^^^^^^^^^ associated type not allowed here
6+
7+ error: aborting due to 1 previous error
8+
9+ For more information about this error, try `rustc --explain E0229`.
You can’t perform that action at this time.
0 commit comments