Add a fn main() {}
to a doctest to prevent the test from being wrapped in a fn main() {}
body
This commit is contained in:
parent
0bc2001879
commit
85f2ecab57
2 changed files with 6 additions and 0 deletions
|
@ -39,6 +39,8 @@ type Foo<T> = impl std::fmt::Debug;
|
|||
fn foo<U>() -> Foo<U> {
|
||||
5u32
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
||||
This means that no matter the generic parameter to `foo`,
|
||||
|
@ -57,4 +59,6 @@ type Foo<T: Debug> = impl Debug;
|
|||
fn foo<U: Debug>() -> Foo<U> {
|
||||
Vec::<U>::new()
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue