-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d447a9
commit a233b16
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![feature(associated_type_bounds)] | ||
|
||
// Test for <https://github.com/rust-lang/rust/issues/119857>. | ||
|
||
pub trait Iter { | ||
type Item<'a>: 'a where Self: 'a; | ||
|
||
fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>; | ||
//~^ ERROR associated type bindings are not allowed here | ||
} | ||
|
||
impl Iter for () { | ||
type Item<'a> = &'a mut [()]; | ||
|
||
fn next<'a>(&'a mut self) -> Option<Self::Item<'a>> { None } | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0229]: associated type bindings are not allowed here | ||
--> $DIR/no-gat-position.rs:8:56 | ||
| | ||
LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>; | ||
| ^^^^^^^^^ associated type not allowed here | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0229`. |