mirror of https://github.com/rust-lang/reference
Remove use of `ignore` from examples.
This commit is contained in:
parent
5f49f2d882
commit
3f5f3b2428
|
@ -31,15 +31,15 @@ The caller must provide a type that satisfies the bounds declared by the anonymo
|
|||
|
||||
For example, these two forms are almost equivalent:
|
||||
|
||||
```rust,ignore
|
||||
```rust
|
||||
trait Trait {}
|
||||
|
||||
// generic type parameter
|
||||
fn foo<T: Trait>(arg: T) {
|
||||
fn with_generic_type<T: Trait>(arg: T) {
|
||||
}
|
||||
|
||||
// impl Trait in argument position
|
||||
fn foo(arg: impl Trait) {
|
||||
fn with_impl_trait(arg: impl Trait) {
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -96,8 +96,11 @@ With `impl Trait`, unlike with a generic type parameter, the function chooses th
|
|||
|
||||
The function:
|
||||
|
||||
```rust,ignore
|
||||
```rust
|
||||
# trait Trait {}
|
||||
fn foo<T: Trait>() -> T {
|
||||
// ...
|
||||
# panic!()
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -105,8 +108,11 @@ allows the caller to determine the return type, `T`, and the function returns th
|
|||
|
||||
The function:
|
||||
|
||||
```rust,ignore
|
||||
```rust
|
||||
# trait Trait {}
|
||||
# impl Trait for () {}
|
||||
fn foo() -> impl Trait {
|
||||
// ...
|
||||
}
|
||||
```
|
||||
|
||||
|
|
Loading…
Reference in New Issue