rust/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
516 B
Rust
Raw Normal View History

// run-pass
2020-05-17 08:22:48 +00:00
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
trait Iterator {
fn next(&self);
}
trait WithAssoc {
type Item;
}
impl<'a> WithAssoc for &'a () {
type Item = &'a u32;
}
struct Cloned<I>(#[allow(dead_code)] I);
impl<'a, I, T: 'a> Iterator for Cloned<I>
where I: WithAssoc<Item=&'a T>, T: Clone
{
fn next(&self) {}
}
impl<'a, I, T: 'a> Iterator for Cloned<I>
where I: WithAssoc<Item=&'a T>, T: Copy
{
}
fn main() {
Cloned(&()).next();
}