rust/tests/ui/traits/monomorphized-callees-with-ty-params-3314.rs

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

33 lines
523 B
Rust
Raw Normal View History

// run-pass
// pretty-expanded FIXME #23616
2015-04-18 05:12:20 +00:00
trait Serializer {
}
trait Serializable {
fn serialize<S:Serializer>(&self, s: S);
}
impl Serializable for isize {
fn serialize<S:Serializer>(&self, _s: S) { }
}
struct F<A> { a: A }
impl<A:Serializable> Serializable for F<A> {
fn serialize<S:Serializer>(&self, s: S) {
2013-02-15 10:44:18 +00:00
self.a.serialize(s);
}
}
impl Serializer for isize {
}
pub fn main() {
2015-01-25 21:05:03 +00:00
let foo = F { a: 1 };
foo.serialize(1);
2015-01-25 21:05:03 +00:00
let bar = F { a: F {a: 1 } };
bar.serialize(2);
}