]>
git.proxmox.com Git - rustc.git/blob - src/test/auxiliary/specialization_cross_crate.rs
1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![feature(specialization)]
14 fn foo(&self) -> &'
static str;
18 default fn foo(&self) -> &'
static str {
23 impl<T
: Clone
> Foo
for T
{
24 default fn foo(&self) -> &'
static str {
29 impl<T
, U
> Foo
for (T
, U
) where T
: Clone
, U
: Clone
{
30 default fn foo(&self) -> &'
static str {
35 impl<T
: Clone
> Foo
for (T
, T
) {
36 default fn foo(&self) -> &'
static str {
37 "generic uniform pair"
41 impl Foo
for (u8, u32) {
42 default fn foo(&self) -> &'
static str {
47 impl Foo
for (u8, u8) {
48 default fn foo(&self) -> &'
static str {
53 impl<T
: Clone
> Foo
for Vec
<T
> {
54 default fn foo(&self) -> &'
static str {
59 impl Foo
for Vec
<i32> {
60 fn foo(&self) -> &'
static str {
66 fn foo(&self) -> &'
static str {
72 fn foo(&self) -> &'
static str {
78 impl<T
: Clone
+ MyMarker
> Foo
for T
{
79 default fn foo(&self) -> &'
static str {
80 "generic Clone + MyMarker"