2014-02-03 19:31:00 -06:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2015-02-21 05:28:28 -06:00
|
|
|
use std::fmt::Debug;
|
2014-10-09 16:19:50 -05:00
|
|
|
use std::default::Default;
|
2014-02-03 19:31:00 -06:00
|
|
|
|
2014-10-09 16:19:50 -05:00
|
|
|
// Test that a blank impl for all T conflicts with an impl for some
|
|
|
|
// specific T, even when there are multiple type parameters involved.
|
2014-02-03 19:31:00 -06:00
|
|
|
|
2014-10-09 16:19:50 -05:00
|
|
|
trait MyTrait<T> {
|
|
|
|
fn get(&self) -> T;
|
2014-02-03 19:31:00 -06:00
|
|
|
}
|
|
|
|
|
2015-12-29 23:18:24 -06:00
|
|
|
impl<T> MyTrait<T> for T {
|
2014-10-09 16:19:50 -05:00
|
|
|
fn get(&self) -> T {
|
2014-10-09 14:17:22 -05:00
|
|
|
panic!()
|
2014-10-09 16:19:50 -05:00
|
|
|
}
|
2014-02-03 19:31:00 -06:00
|
|
|
}
|
2014-10-09 16:19:50 -05:00
|
|
|
|
2014-12-30 22:32:49 -06:00
|
|
|
#[derive(Clone)]
|
2014-10-09 16:19:50 -05:00
|
|
|
struct MyType {
|
2015-01-08 05:02:42 -06:00
|
|
|
dummy: usize
|
2014-10-09 16:19:50 -05:00
|
|
|
}
|
|
|
|
|
2015-12-29 23:18:24 -06:00
|
|
|
impl MyTrait<MyType> for MyType { //~ ERROR E0119
|
2015-01-08 05:02:42 -06:00
|
|
|
fn get(&self) -> usize { (*self).clone() }
|
2014-10-09 16:19:50 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() { }
|