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
@ -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() {}
|
||||
```
|
||||
|
@ -46,6 +46,8 @@
|
||||
/// fn test() -> impl Trait<Assoc = Tait> {
|
||||
/// 42
|
||||
/// }
|
||||
///
|
||||
/// fn main() {}
|
||||
/// ```
|
||||
///
|
||||
/// {{produces}}
|
||||
|
Loading…
Reference in New Issue
Block a user