Add a fn main() {} to a doctest to prevent the test from being wrapped in a fn main() {} body
This commit is contained in:
@@ -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() {}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user