Skip to content

Commit a233b16

Browse files
Add an ATB test
1 parent 1d447a9 commit a233b16

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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`.

0 commit comments

Comments
 (0)