mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
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> {
|
fn foo<U>() -> Foo<U> {
|
||||||
5u32
|
5u32
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
```
|
```
|
||||||
|
|
||||||
This means that no matter the generic parameter to `foo`,
|
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> {
|
fn foo<U: Debug>() -> Foo<U> {
|
||||||
Vec::<U>::new()
|
Vec::<U>::new()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
||||||
```
|
```
|
||||||
|
@ -46,6 +46,8 @@ declare_lint! {
|
|||||||
/// fn test() -> impl Trait<Assoc = Tait> {
|
/// fn test() -> impl Trait<Assoc = Tait> {
|
||||||
/// 42
|
/// 42
|
||||||
/// }
|
/// }
|
||||||
|
///
|
||||||
|
/// fn main() {}
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// {{produces}}
|
/// {{produces}}
|
||||||
|
Loading…
Reference in New Issue
Block a user