Traits where syntax's extra usage example more clearly
r? @steveklabnik
This commit is contained in:
parent
be203ac258
commit
d0a0befb54
1 changed files with 2 additions and 2 deletions
|
|
@ -397,10 +397,10 @@ fn normal<T: ConvertTo<i64>>(x: &T) -> i64 {
|
|||
}
|
||||
|
||||
// can be called with T == i64
|
||||
fn inverse<T>() -> T
|
||||
fn inverse<T>(x: i32) -> T
|
||||
// this is using ConvertTo as if it were "ConvertTo<i64>"
|
||||
where i32: ConvertTo<T> {
|
||||
42.convert()
|
||||
x.convert()
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue