2012-12-11 01:32:48 +00:00
|
|
|
// Copyright 2012 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.
|
|
|
|
|
2013-05-07 21:30:21 +00:00
|
|
|
// Tests that impls are allowed to have looser, more permissive bounds
|
|
|
|
// than the traits require.
|
2012-09-05 22:36:11 +00:00
|
|
|
|
|
|
|
trait A {
|
2013-07-10 21:43:25 +00:00
|
|
|
fn b<C:Freeze,D>(x: C) -> C;
|
2012-09-05 22:36:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct E {
|
2012-09-07 21:50:47 +00:00
|
|
|
f: int
|
2012-09-05 22:36:11 +00:00
|
|
|
}
|
|
|
|
|
2013-02-14 19:47:00 +00:00
|
|
|
impl A for E {
|
2013-07-10 21:43:25 +00:00
|
|
|
fn b<F,G>(_x: F) -> F { fail!() } //~ ERROR in method `b`, type parameter 0 has 1 bound, but
|
2012-09-05 22:36:11 +00:00
|
|
|
}
|
|
|
|
|
2013-02-01 01:51:01 +00:00
|
|
|
fn main() {}
|