Remove use of `ignore` from examples.

This commit is contained in:
Eric Huss 2023-05-22 10:39:42 -07:00 committed by GitHub
parent 5f49f2d882
commit 3f5f3b2428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 5 deletions

View File

@ -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 {
// ...
}
```