mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00

Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
16 lines
332 B
Rust
16 lines
332 B
Rust
//@ check-pass
|
|
// Tests that type parameter bounds on an implementation need not match the
|
|
// trait exactly, as long as the implementation doesn't demand *more* bounds
|
|
// than the trait.
|
|
|
|
|
|
trait A {
|
|
fn foo<T: Eq + Ord>(&self);
|
|
}
|
|
|
|
impl A for isize {
|
|
fn foo<T: Ord>(&self) {} // Ord implies Eq, so this is ok.
|
|
}
|
|
|
|
fn main() {}
|