mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 03:33:59 +00:00
14 lines
257 B
Rust
14 lines
257 B
Rust
//@ run-pass
|
|
trait Collection where for<'a> &'a Self: IntoIterator {
|
|
fn my_iter(&self) -> <&Self as IntoIterator>::IntoIter {
|
|
self.into_iter()
|
|
}
|
|
}
|
|
|
|
impl<T> Collection for [T] { }
|
|
|
|
fn main() {
|
|
let v = [0usize];
|
|
let _ = v.my_iter();
|
|
}
|